time_rotating (Resource)

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.

Example Usage

Basic Usage

// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
import { Construct } from "constructs";
import { TerraformStack } from "cdktf";
/*
 * Provider bindings are generated by running `cdktf get`.
 * See https://cdk.tf/provider-generation for more details.
 */
import { Rotating } from "./.gen/providers/time/rotating";
class MyConvertedCode extends TerraformStack {
  constructor(scope: Construct, name: string) {
    super(scope, name);
    new Rotating(this, "example", {
      rotationDays: 30,
    });
  }
}

Schema

Optional

Read-Only

Import

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.