đź§ The Core Concept: The “Trigger”
The primary purpose of time_rotating is to force other resources to recreate themselves. It’s a dependency anchor.
When the rotation period expires (e.g., 30 days), the time_rotating resource is marked as “changed” in the state file. Any resource that references its ID will also be forced to update or replace.
A Real-World Implementation
Here is how you actually use it to rotate a database password every 30 days:
| |
Key Attributes to Know rotation_days / rotation_hours / rotation_minutes: Defines how often the “alarm” goes off.
rfc3339: The output timestamp of the last rotation.
id: A unique value that changes every time a rotation occurs. This is what you usually pass into the keepers block of other resources.