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
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.null.resource import Resource
from imports.time.sleep import Sleep
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
null_resource_previous = Resource(self, "previous")
wait30_seconds = Sleep(self, "wait_30_seconds",
create_duration="30s",
depends_on=[null_resource_previous]
)
Resource(self, "next",
depends_on=[wait30_seconds]
)
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.null.resource import Resource
from imports.time.sleep import Sleep
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
null_resource_previous = Resource(self, "previous")
wait30_seconds = Sleep(self, "wait_30_seconds",
depends_on=[null_resource_previous],
destroy_duration="30s"
)
Resource(self, "next",
depends_on=[wait30_seconds]
)
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import Token, Fn, TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.aws.db_subnet_group import DbSubnetGroup
from imports.aws.ram_resource_association import RamResourceAssociation
from imports.time.sleep import Sleep
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
example = RamResourceAssociation(self, "example",
resource_arn=Token.as_string(aws_subnet_example.arn),
resource_share_arn=Token.as_string(aws_ram_resource_share_example.arn)
)
ram_resource_propagation = Sleep(self, "ram_resource_propagation",
create_duration="60s",
triggers={
"subnet_arn": example.resource_arn,
"subnet_id": Token.as_string(aws_subnet_example.id)
}
)
aws_db_subnet_group_example = DbSubnetGroup(self, "example_2",
name="example",
subnet_ids=[
Token.as_string(
Fn.lookup_nested(ram_resource_propagation.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.
aws_db_subnet_group_example.override_logical_id("example")
create_duration
(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.destroy_duration
(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 create_duration
and destroy_duration
, 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.