Class CfnWaitCondition
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::CloudFormation::WaitCondition.
For Amazon EC2 and Auto Scaling resources, we recommend that you use a
CreationPolicyattribute instead of wait conditions. Add a CreationPolicy attribute to those resources, and use the cfn-signal helper script to signal when an instance creation process has completed successfully.
You can use a wait condition for situations like the following:
- To coordinate stack resource creation with configuration actions that are external to the stack creation.
- To track the status of a configuration process.
For these situations, we recommend that you associate a CreationPolicy attribute with the wait condition so that you don't have to use a wait condition handle. For more information and an example, see Creating wait conditions in a template . If you use a CreationPolicy with a wait condition, don't specify any of the wait condition's properties.
If you use the VPC endpoints feature, resources in the VPC that respond to wait conditions must have access to CloudFormation , specific Amazon Simple Storage Service ( Amazon S3 ) buckets. Resources must send wait condition responses to a presigned Amazon S3 URL. If they can't send responses to Amazon S3 , CloudFormation won't receive a response and the stack operation fails. For more information, see Setting up VPC endpoints for AWS CloudFormation .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudformation.*;
CfnWaitCondition cfnWaitCondition = CfnWaitCondition.Builder.create(this, "MyCfnWaitCondition")
.count(123)
.handle("handle")
.timeout("timeout")
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnWaitCondition(Construct scope, String id) Create a newAWS::CloudFormation::WaitCondition.CfnWaitCondition(Construct scope, String id, CfnWaitConditionProps props) Create a newAWS::CloudFormation::WaitCondition.protectedCfnWaitCondition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnWaitCondition(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionA JSON object that contains theUniqueIdandDatavalues from the wait condition signal(s) for the specified wait condition.getCount()The number of success signals that CloudFormation must receive before it continues the stack creation process.A reference to the wait condition handle used to signal this wait condition.The length of time (in seconds) to wait for the number of signals that theCountproperty specifies.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidThe number of success signals that CloudFormation must receive before it continues the stack creation process.voidA reference to the wait condition handle used to signal this wait condition.voidsetTimeout(String value) The length of time (in seconds) to wait for the number of signals that theCountproperty specifies.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnWaitCondition
protected CfnWaitCondition(software.amazon.jsii.JsiiObjectRef objRef) -
CfnWaitCondition
protected CfnWaitCondition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnWaitCondition
@Stability(Stable) public CfnWaitCondition(@NotNull Construct scope, @NotNull String id, @Nullable CfnWaitConditionProps props) Create a newAWS::CloudFormation::WaitCondition.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
CfnWaitCondition
Create a newAWS::CloudFormation::WaitCondition.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrData
A JSON object that contains theUniqueIdandDatavalues from the wait condition signal(s) for the specified wait condition.For more information about wait condition signals, see Wait condition signal JSON format .
Example return value for a wait condition with 2 signals:
{ "Signal1" : "Step 1 complete." , "Signal2" : "Step 2 complete." } -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getCount
The number of success signals that CloudFormation must receive before it continues the stack creation process.When the wait condition receives the requisite number of success signals, CloudFormation resumes the creation of the stack. If the wait condition doesn't receive the specified number of success signals before the Timeout period expires, CloudFormation assumes that the wait condition has failed and rolls the stack back.
Updates aren't supported.
-
setCount
The number of success signals that CloudFormation must receive before it continues the stack creation process.When the wait condition receives the requisite number of success signals, CloudFormation resumes the creation of the stack. If the wait condition doesn't receive the specified number of success signals before the Timeout period expires, CloudFormation assumes that the wait condition has failed and rolls the stack back.
Updates aren't supported.
-
getHandle
A reference to the wait condition handle used to signal this wait condition.Use the
Refintrinsic function to specify anAWS::CloudFormation::WaitConditionHandleresource.Anytime you add a
WaitConditionresource during a stack update, you must associate the wait condition with a new WaitConditionHandle resource. Don't reuse an old wait condition handle that has already been defined in the template. If you reuse a wait condition handle, the wait condition might evaluate old signals from a previous create or update stack command.Updates aren't supported.
-
setHandle
A reference to the wait condition handle used to signal this wait condition.Use the
Refintrinsic function to specify anAWS::CloudFormation::WaitConditionHandleresource.Anytime you add a
WaitConditionresource during a stack update, you must associate the wait condition with a new WaitConditionHandle resource. Don't reuse an old wait condition handle that has already been defined in the template. If you reuse a wait condition handle, the wait condition might evaluate old signals from a previous create or update stack command.Updates aren't supported.
-
getTimeout
The length of time (in seconds) to wait for the number of signals that theCountproperty specifies.Timeoutis a minimum-bound property, meaning the timeout occurs no sooner than the time you specify, but can occur shortly thereafter. The maximum time that can be specified for this property is 12 hours (43200 seconds).Updates aren't supported.
-
setTimeout
The length of time (in seconds) to wait for the number of signals that theCountproperty specifies.Timeoutis a minimum-bound property, meaning the timeout occurs no sooner than the time you specify, but can occur shortly thereafter. The maximum time that can be specified for this property is 12 hours (43200 seconds).Updates aren't supported.
-