-
Notifications
You must be signed in to change notification settings - Fork 17
/
awscdk_CfnCreationPolicy.go
45 lines (42 loc) · 2.44 KB
/
awscdk_CfnCreationPolicy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// An experiment to bundle the entire CDK into a single module
package awscdk
// 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.
//
// 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,
// and AWS::CloudFormation::WaitCondition.
//
// 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.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import monocdk "github.com/aws/aws-cdk-go/awscdk"
//
// cfnCreationPolicy := &cfnCreationPolicy{
// autoScalingCreationPolicy: &cfnResourceAutoScalingCreationPolicy{
// minSuccessfulInstancesPercent: jsii.Number(123),
// },
// resourceSignal: &cfnResourceSignal{
// count: jsii.Number(123),
// timeout: jsii.String("timeout"),
// },
// }
//
// Experimental.
type CfnCreationPolicy struct {
// For an Auto Scaling group replacement update, specifies how many instances must signal success for the update to succeed.
// Experimental.
AutoScalingCreationPolicy *CfnResourceAutoScalingCreationPolicy `field:"optional" json:"autoScalingCreationPolicy" yaml:"autoScalingCreationPolicy"`
// 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.
// Experimental.
ResourceSignal *CfnResourceSignal `field:"optional" json:"resourceSignal" yaml:"resourceSignal"`
}