Manages a rotating time resource, which keeps a rotating UTC timestamp stored in the Terraform state and proposes resource recreation when the locally sourced current time is beyond the rotation time. This rotation only occurs when Terraform is executed, meaning there will be drift between the rotation timestamp and actual rotation. The new rotation timestamp offset includes this drift. This prevents perpetual differences caused by using the timestamp()
function by only forcing a new value on the set cadence.
resource "time_rotating" "example" {
rotation_days = 30
}
rfc3339
(String) Base timestamp in RFC3339 format (see RFC3339 time string e.g., YYYY-MM-DDTHH:MM:SSZ
). Defaults to the current time.rotation_days
(Number) Number of days to add to the base timestamp to configure the rotation timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation. At least one of the 'rotation_' arguments must be configured.rotation_hours
(Number) Number of hours to add to the base timestamp to configure the rotation timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation. At least one of the 'rotation_' arguments must be configured.rotation_minutes
(Number) Number of minutes to add to the base timestamp to configure the rotation timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation. At least one of the 'rotation_' arguments must be configured.rotation_months
(Number) Number of months to add to the base timestamp to configure the rotation timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation. At least one of the 'rotation_' arguments must be configured.rotation_rfc3339
(String) Configure the rotation timestamp with an RFC3339 format of the offset timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation. At least one of the 'rotation_' arguments must be configured.rotation_years
(Number) Number of years to add to the base timestamp to configure the rotation timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation. At least one of the 'rotation_' arguments must be configured.triggers
(Map of String) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. These conditions recreate the resource in addition to other rotation arguments. See the main provider documentation for more information.day
(Number) Number day of timestamp.hour
(Number) Number hour of timestamp.id
(String) RFC3339 format of the timestamp, e.g. 2020-02-12T06:36:13Z
.minute
(Number) Number minute of timestamp.month
(Number) Number month of timestamp.second
(Number) Number second of timestamp.unix
(Number) Number of seconds since epoch time, e.g. 1581489373
.year
(Number) Number year of timestamp.This resource can be imported using the base UTC RFC3339 value and rotation years, months, days, hours, and minutes, separated by commas (,
), e.g. for 30 days
terraform import time_rotating.example 2020-02-12T06:36:13Z,0,0,30,0,0
Otherwise, to import with the rotation RFC3339 value, the base UTC RFC3339 value and rotation UTC RFC3339 value, separated by commas (,
), e.g.
terraform import time_rotating.example 2020-02-12T06:36:13Z,2020-02-13T06:36:13Z
The triggers
argument cannot be imported.