Class CfnCreationPolicy
Associate the CreationPolicy attribute with a resource to prevent its status from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded.
Inheritance
Implements
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnCreationPolicy : Object, ICfnCreationPolicy
Syntax (vb)
Public Class CfnCreationPolicy
Inherits Object
Implements ICfnCreationPolicy
Remarks
To signal a resource, you can use the cfn-signal helper script or SignalResource API. AWS CloudFormation publishes valid signals to the stack events so that you track the number of signals sent.
The creation policy is invoked only when AWS CloudFormation creates the associated resource. Currently, the only AWS CloudFormation resources that support creation policies are AWS::AutoScaling::AutoScalingGroup, AWS::EC2::Instance, AWS::CloudFormation::WaitCondition and AWS::AppStream::Fleet.
Use the CreationPolicy attribute when you want to wait on resource configuration actions before stack creation proceeds. For example, if you install and configure software applications on an EC2 instance, you might want those applications to be running before proceeding. In such cases, you can add a CreationPolicy attribute to the instance, and then send a success signal to the instance after the applications are installed and configured. For a detailed example, see Deploying Applications on Amazon EC2 with AWS CloudFormation.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
var cfnCreationPolicy = new CfnCreationPolicy {
AutoScalingCreationPolicy = new CfnResourceAutoScalingCreationPolicy {
MinSuccessfulInstancesPercent = 123
},
ResourceSignal = new CfnResourceSignal {
Count = 123,
Timeout = "timeout"
},
StartFleet = false
};
Synopsis
Constructors
CfnCreationPolicy() |
Properties
AutoScalingCreationPolicy | For an Auto Scaling group replacement update, specifies how many instances must signal success for the update to succeed. |
ResourceSignal | When AWS CloudFormation creates the associated resource, configures the number of required success signals and the length of time that AWS CloudFormation waits for those signals. |
StartFleet | For an AppStream Fleet creation, specifies that the fleet is started after creation. |
Constructors
CfnCreationPolicy()
public CfnCreationPolicy()
Properties
AutoScalingCreationPolicy
For an Auto Scaling group replacement update, specifies how many instances must signal success for the update to succeed.
public ICfnResourceAutoScalingCreationPolicy AutoScalingCreationPolicy { get; set; }
Property Value
ICfnResourceAutoScalingCreationPolicy
ResourceSignal
When AWS CloudFormation creates the associated resource, configures the number of required success signals and the length of time that AWS CloudFormation waits for those signals.
public ICfnResourceSignal ResourceSignal { get; set; }
Property Value
StartFleet
For an AppStream Fleet creation, specifies that the fleet is started after creation.
public Nullable<bool> StartFleet { get; set; }
Property Value
System.Nullable<System.Boolean>