UNPKG

14.5 kBTypeScriptView Raw
1/**
2 * Associate the CreationPolicy attribute with a resource to prevent its status from reaching create complete until
3 * AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded. To signal a
4 * resource, you can use the cfn-signal helper script or SignalResource API. AWS CloudFormation publishes valid signals
5 * to the stack events so that you track the number of signals sent.
6 *
7 * The creation policy is invoked only when AWS CloudFormation creates the associated resource. Currently, the only
8 * AWS CloudFormation resources that support creation policies are AWS::AutoScaling::AutoScalingGroup, AWS::EC2::Instance,
9 * and AWS::CloudFormation::WaitCondition.
10 *
11 * Use the CreationPolicy attribute when you want to wait on resource configuration actions before stack creation proceeds.
12 * For example, if you install and configure software applications on an EC2 instance, you might want those applications to
13 * be running before proceeding. In such cases, you can add a CreationPolicy attribute to the instance, and then send a success
14 * signal to the instance after the applications are installed and configured. For a detailed example, see Deploying Applications
15 * on Amazon EC2 with AWS CloudFormation.
16 */
17export interface CfnCreationPolicy {
18 /**
19 * For an Auto Scaling group replacement update, specifies how many instances must signal success for the
20 * update to succeed.
21 */
22 readonly autoScalingCreationPolicy?: CfnResourceAutoScalingCreationPolicy;
23 /**
24 * When AWS CloudFormation creates the associated resource, configures the number of required success signals and
25 * the length of time that AWS CloudFormation waits for those signals.
26 */
27 readonly resourceSignal?: CfnResourceSignal;
28}
29/**
30 * For an Auto Scaling group replacement update, specifies how many instances must signal success for the
31 * update to succeed.
32 */
33export interface CfnResourceAutoScalingCreationPolicy {
34 /**
35 * Specifies the percentage of instances in an Auto Scaling replacement update that must signal success for the
36 * update to succeed. You can specify a value from 0 to 100. AWS CloudFormation rounds to the nearest tenth of a percent.
37 * For example, if you update five instances with a minimum successful percentage of 50, three instances must signal success.
38 * If an instance doesn't send a signal within the time specified by the Timeout property, AWS CloudFormation assumes that the
39 * instance wasn't created.
40 */
41 readonly minSuccessfulInstancesPercent?: number;
42}
43/**
44 * When AWS CloudFormation creates the associated resource, configures the number of required success signals and
45 * the length of time that AWS CloudFormation waits for those signals.
46 */
47export interface CfnResourceSignal {
48 /**
49 * The number of success signals AWS CloudFormation must receive before it sets the resource status as CREATE_COMPLETE.
50 * If the resource receives a failure signal or doesn't receive the specified number of signals before the timeout period
51 * expires, the resource creation fails and AWS CloudFormation rolls the stack back.
52 */
53 readonly count?: number;
54 /**
55 * The length of time that AWS CloudFormation waits for the number of signals that was specified in the Count property.
56 * The timeout period starts after AWS CloudFormation starts creating the resource, and the timeout expires no sooner
57 * than the time you specify but can occur shortly thereafter. The maximum time that you can specify is 12 hours.
58 */
59 readonly timeout?: string;
60}
61/**
62 * With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted.
63 * You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy
64 * attribute, AWS CloudFormation deletes the resource by default. Note that this capability also applies to update operations
65 * that lead to resources being removed.
66 */
67export declare enum CfnDeletionPolicy {
68 /**
69 * AWS CloudFormation deletes the resource and all its content if applicable during stack deletion. You can add this
70 * deletion policy to any resource type. By default, if you don't specify a DeletionPolicy, AWS CloudFormation deletes
71 * your resources. However, be aware of the following considerations:
72 */
73 DELETE = "Delete",
74 /**
75 * AWS CloudFormation keeps the resource without deleting the resource or its contents when its stack is deleted.
76 * You can add this deletion policy to any resource type. Note that when AWS CloudFormation completes the stack deletion,
77 * the stack will be in Delete_Complete state; however, resources that are retained continue to exist and continue to incur
78 * applicable charges until you delete those resources.
79 */
80 RETAIN = "Retain",
81 /**
82 * For resources that support snapshots (AWS::EC2::Volume, AWS::ElastiCache::CacheCluster, AWS::ElastiCache::ReplicationGroup,
83 * AWS::RDS::DBInstance, AWS::RDS::DBCluster, and AWS::Redshift::Cluster), AWS CloudFormation creates a snapshot for the
84 * resource before deleting it. Note that when AWS CloudFormation completes the stack deletion, the stack will be in the
85 * Delete_Complete state; however, the snapshots that are created with this policy continue to exist and continue to
86 * incur applicable charges until you delete those snapshots.
87 */
88 SNAPSHOT = "Snapshot"
89}
90/**
91 * Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup
92 * resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a
93 * scheduled action is associated with the Auto Scaling group.
94 */
95export interface CfnUpdatePolicy {
96 /**
97 * Specifies whether an Auto Scaling group and the instances it contains are replaced during an update. During replacement,
98 * AWS CloudFormation retains the old group until it finishes creating the new one. If the update fails, AWS CloudFormation
99 * can roll back to the old Auto Scaling group and delete the new Auto Scaling group.
100 */
101 readonly autoScalingReplacingUpdate?: CfnAutoScalingReplacingUpdate;
102 /**
103 * To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate
104 * policy. Rolling updates enable you to specify whether AWS CloudFormation updates instances that are in an Auto Scaling
105 * group in batches or all at once.
106 */
107 readonly autoScalingRollingUpdate?: CfnAutoScalingRollingUpdate;
108 /**
109 * To specify how AWS CloudFormation handles updates for the MinSize, MaxSize, and DesiredCapacity properties when
110 * the AWS::AutoScaling::AutoScalingGroup resource has an associated scheduled action, use the AutoScalingScheduledAction
111 * policy.
112 */
113 readonly autoScalingScheduledAction?: CfnAutoScalingScheduledAction;
114 /**
115 * To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource,
116 * use the CodeDeployLambdaAliasUpdate update policy.
117 */
118 readonly codeDeployLambdaAliasUpdate?: CfnCodeDeployLambdaAliasUpdate;
119 /**
120 * To modify a replication group's shards by adding or removing shards, rather than replacing the entire
121 * AWS::ElastiCache::ReplicationGroup resource, use the UseOnlineResharding update policy.
122 */
123 readonly useOnlineResharding?: boolean;
124 /**
125 * To upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire
126 * AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy.
127 */
128 readonly enableVersionUpgrade?: boolean;
129}
130/**
131 * To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate
132 * policy. Rolling updates enable you to specify whether AWS CloudFormation updates instances that are in an Auto Scaling
133 * group in batches or all at once.
134 */
135export interface CfnAutoScalingRollingUpdate {
136 /**
137 * Specifies the maximum number of instances that AWS CloudFormation updates.
138 */
139 readonly maxBatchSize?: number;
140 /**
141 * Specifies the minimum number of instances that must be in service within the Auto Scaling group while AWS
142 * CloudFormation updates old instances.
143 */
144 readonly minInstancesInService?: number;
145 /**
146 * Specifies the percentage of instances in an Auto Scaling rolling update that must signal success for an update to succeed.
147 * You can specify a value from 0 to 100. AWS CloudFormation rounds to the nearest tenth of a percent. For example, if you
148 * update five instances with a minimum successful percentage of 50, three instances must signal success.
149 *
150 * If an instance doesn't send a signal within the time specified in the PauseTime property, AWS CloudFormation assumes
151 * that the instance wasn't updated.
152 *
153 * If you specify this property, you must also enable the WaitOnResourceSignals and PauseTime properties.
154 */
155 readonly minSuccessfulInstancesPercent?: number;
156 /**
157 * The amount of time that AWS CloudFormation pauses after making a change to a batch of instances to give those instances
158 * time to start software applications. For example, you might need to specify PauseTime when scaling up the number of
159 * instances in an Auto Scaling group.
160 *
161 * If you enable the WaitOnResourceSignals property, PauseTime is the amount of time that AWS CloudFormation should wait
162 * for the Auto Scaling group to receive the required number of valid signals from added or replaced instances. If the
163 * PauseTime is exceeded before the Auto Scaling group receives the required number of signals, the update fails. For best
164 * results, specify a time period that gives your applications sufficient time to get started. If the update needs to be
165 * rolled back, a short PauseTime can cause the rollback to fail.
166 *
167 * Specify PauseTime in the ISO8601 duration format (in the format PT#H#M#S, where each # is the number of hours, minutes,
168 * and seconds, respectively). The maximum PauseTime is one hour (PT1H).
169 */
170 readonly pauseTime?: string;
171 /**
172 * Specifies the Auto Scaling processes to suspend during a stack update. Suspending processes prevents Auto Scaling from
173 * interfering with a stack update. For example, you can suspend alarming so that Auto Scaling doesn't execute scaling
174 * policies associated with an alarm. For valid values, see the ScalingProcesses.member.N parameter for the SuspendProcesses
175 * action in the Auto Scaling API Reference.
176 */
177 readonly suspendProcesses?: string[];
178 /**
179 * Specifies whether the Auto Scaling group waits on signals from new instances during an update. Use this property to
180 * ensure that instances have completed installing and configuring applications before the Auto Scaling group update proceeds.
181 * AWS CloudFormation suspends the update of an Auto Scaling group after new EC2 instances are launched into the group.
182 * AWS CloudFormation must receive a signal from each new instance within the specified PauseTime before continuing the update.
183 * To signal the Auto Scaling group, use the cfn-signal helper script or SignalResource API.
184 *
185 * To have instances wait for an Elastic Load Balancing health check before they signal success, add a health-check
186 * verification by using the cfn-init helper script. For an example, see the verify_instance_health command in the Auto Scaling
187 * rolling updates sample template.
188 */
189 readonly waitOnResourceSignals?: boolean;
190}
191/**
192 * Specifies whether an Auto Scaling group and the instances it contains are replaced during an update. During replacement,
193 * AWS CloudFormation retains the old group until it finishes creating the new one. If the update fails, AWS CloudFormation
194 * can roll back to the old Auto Scaling group and delete the new Auto Scaling group.
195 *
196 * While AWS CloudFormation creates the new group, it doesn't detach or attach any instances. After successfully creating
197 * the new Auto Scaling group, AWS CloudFormation deletes the old Auto Scaling group during the cleanup process.
198 *
199 * When you set the WillReplace parameter, remember to specify a matching CreationPolicy. If the minimum number of
200 * instances (specified by the MinSuccessfulInstancesPercent property) don't signal success within the Timeout period
201 * (specified in the CreationPolicy policy), the replacement update fails and AWS CloudFormation rolls back to the old
202 * Auto Scaling group.
203 */
204export interface CfnAutoScalingReplacingUpdate {
205 readonly willReplace?: boolean;
206}
207/**
208 * With scheduled actions, the group size properties of an Auto Scaling group can change at any time. When you update a
209 * stack with an Auto Scaling group and scheduled action, AWS CloudFormation always sets the group size property values of
210 * your Auto Scaling group to the values that are defined in the AWS::AutoScaling::AutoScalingGroup resource of your template,
211 * even if a scheduled action is in effect.
212 *
213 * If you do not want AWS CloudFormation to change any of the group size property values when you have a scheduled action in
214 * effect, use the AutoScalingScheduledAction update policy to prevent AWS CloudFormation from changing the MinSize, MaxSize,
215 * or DesiredCapacity properties unless you have modified these values in your template.\
216 */
217export interface CfnAutoScalingScheduledAction {
218 readonly ignoreUnmodifiedGroupSizeProperties?: boolean;
219}
220/**
221 * To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource,
222 * use the CodeDeployLambdaAliasUpdate update policy.
223 */
224export interface CfnCodeDeployLambdaAliasUpdate {
225 /**
226 * The name of the AWS CodeDeploy application.
227 */
228 readonly applicationName: string;
229 /**
230 * The name of the AWS CodeDeploy deployment group. This is where the traffic-shifting policy is set.
231 */
232 readonly deploymentGroupName: string;
233 /**
234 * The name of the Lambda function to run before traffic routing starts.
235 */
236 readonly beforeAllowTrafficHook?: string;
237 /**
238 * The name of the Lambda function to run after traffic routing completes.
239 */
240 readonly afterAllowTrafficHook?: string;
241}