Manages a resource that delays creation and/or destruction, typically for further resources. This prevents cross-platform compatibility and destroy-time issues with using the local-exec
provisioner.
// 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 { Resource } from "./.gen/providers/null/resource";
import { Sleep } from "./.gen/providers/time/sleep";
class MyConvertedCode extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
const nullResourcePrevious = new Resource(this, "previous", {});
const wait30Seconds = new Sleep(this, "wait_30_seconds", {
createDuration: "30s",
dependsOn: [nullResourcePrevious],
});
new Resource(this, "next", {
dependsOn: [wait30Seconds],
});
}
}
// 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 { Resource } from "./.gen/providers/null/resource";
import { Sleep } from "./.gen/providers/time/sleep";
class MyConvertedCode extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
const nullResourcePrevious = new Resource(this, "previous", {});
const wait30Seconds = new Sleep(this, "wait_30_seconds", {
dependsOn: [nullResourcePrevious],
destroyDuration: "30s",
});
new Resource(this, "next", {
dependsOn: [wait30Seconds],
});
}
}
// 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 { DbSubnetGroup } from "./.gen/providers/aws/db-subnet-group";
import { RamResourceAssociation } from "./.gen/providers/aws/ram-resource-association";
import { Sleep } from "./.gen/providers/time/sleep";
class MyConvertedCode extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
const example = new RamResourceAssociation(this, "example", {
resourceArn: Token.asString(awsSubnetExample.arn),
resourceShareArn: Token.asString(awsRamResourceShareExample.arn),
});
const ramResourcePropagation = new Sleep(this, "ram_resource_propagation", {
createDuration: "60s",
triggers: {
subnet_arn: example.resourceArn,
subnet_id: Token.asString(awsSubnetExample.id),
},
});
const awsDbSubnetGroupExample = new DbSubnetGroup(this, "example_2", {
name: "example",
subnetIds: [
Token.asString(
Fn.lookupNested(ramResourcePropagation.triggers, ['"subnet_id"'])
),
],
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsDbSubnetGroupExample.overrideLogicalId("example");
}
}
createDuration
(String) Time duration to delay resource creation. For example, 30s
for 30 seconds or 5m
for 5 minutes. Updating this value by itself will not trigger a delay.destroyDuration
(String) Time duration to delay resource destroy. For example, 30s
for 30 seconds or 5m
for 5 minutes. Updating this value by itself will not trigger a delay. This value or any updates to it must be successfully applied into the Terraform state before destroying this resource to take effect.triggers
(Map of String) (Optional) Arbitrary map of values that, when changed, will run any creation or destroy delays again. See the main provider documentation for more information.id
(String) RFC3339 format of the offset timestamp, e.g. 2020-02-12T06:36:13Z
.This resource can be imported with the createDuration
and destroyDuration
, separated by a comma (,
).
e.g. For 30 seconds create duration with no destroy duration:
terraform import time_sleep.example 30s,
e.g. For 30 seconds destroy duration with no create duration:
terraform import time_sleep.example ,30s
The triggers
argument cannot be imported.