Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the timestamp()
function.
// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
import { Construct } from "constructs";
import { TerraformOutput, TerraformStack } from "cdktf";
/*
* Provider bindings are generated by running `cdktf get`.
* See https://cdk.tf/provider-generation for more details.
*/
import { StaticResource } from "./.gen/providers/time/static-resource";
class MyConvertedCode extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
const example = new StaticResource(this, "example", {});
new TerraformOutput(this, "current_time", {
value: example.rfc3339,
});
}
}
// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
import { Construct } from "constructs";
import { Token, Fn, TerraformStack } from "cdktf";
/*
* Provider bindings are generated by running `cdktf get`.
* See https://cdk.tf/provider-generation for more details.
*/
import { Instance } from "./.gen/providers/aws/instance";
import { StaticResource } from "./.gen/providers/time/static-resource";
class MyConvertedCode extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
const amiUpdate = new StaticResource(this, "ami_update", {
triggers: {
ami_id: Token.asString(example.id),
},
});
new Instance(this, "server", {
ami: Token.asString(Fn.lookupNested(amiUpdate, ["triggers", "ami_id"])),
tags: {
AmiUpdateTime: amiUpdate.rfc3339,
},
});
}
}
rfc3339
(String) Base timestamp in RFC3339 format (see RFC3339 time string e.g., YYYY-MM-DDTHH:MM:SSZ
). Defaults to the current time.triggers
(Map of String) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. 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 offset 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 UTC RFC3339 value, e.g.
terraform import time_static.example 2020-02-12T06:36:13Z
The triggers
argument cannot be imported.