@propulsionworks/cloudformation 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,904 @@
1
+ import type { ConditionFunction, FnFindInMap, FnIf, Ref, RuleFunction, ValueFn } from "./intrinsics.ts";
2
+ import type { ParameterType } from "./parameters.ts";
3
+ /**
4
+ * A CloudFormation template, with loosely-typed resources by default.
5
+ *
6
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html}
7
+ */
8
+ export type Template<ResourceType = ResourceDefinition> = {
9
+ /**
10
+ * The AWSTemplateFormatVersion section (optional) identifies the capabilities
11
+ * of the template. The latest template format version is 2010-09-09 and is
12
+ * currently the only valid value.
13
+ *
14
+ * The value for the template format version declaration must be a literal
15
+ * string. You can't use a parameter or function to specify the template
16
+ * format version. If you don't specify a value, AWS CloudFormation assumes
17
+ * the latest template format version.
18
+ *
19
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html}
20
+ */
21
+ AWSTemplateFormatVersion?: "2010-09-09" | undefined;
22
+ /**
23
+ * The optional Conditions section contains statements that define the
24
+ * circumstances under which entities are created or configured. For example,
25
+ * you can create a condition and then associate it with a resource or output
26
+ * so that AWS CloudFormation only creates the resource or output if the
27
+ * condition is true. Similarly, you can associate the condition with a
28
+ * property so that AWS CloudFormation only sets the property to a specific
29
+ * value if the condition is true. If the condition is false, AWS
30
+ * CloudFormation sets the property to a different value that you specify.
31
+ *
32
+ * You might use conditions when you want to reuse a template that can create
33
+ * resources in different contexts, such as a test environment versus a
34
+ * production environment. In your template, you can add an EnvironmentType
35
+ * input parameter, which accepts either prod or test as inputs. For the
36
+ * production environment, you might include Amazon EC2 instances with certain
37
+ * capabilities; however, for the test environment, you want to use reduced
38
+ * capabilities to save money. With conditions, you can define which resources
39
+ * are created and how they're configured for each environment type.
40
+ *
41
+ * Conditions are evaluated based on predefined pseudo parameters or input
42
+ * parameter values that you specify when you create or update a stack. Within
43
+ * each condition, you can reference another condition, a parameter value, or
44
+ * a mapping. After you define all your conditions, you can associate them
45
+ * with resources and resource properties in the Resources and Outputs
46
+ * sections of a template.
47
+ *
48
+ * At stack creation or stack update, AWS CloudFormation evaluates all the
49
+ * conditions in your template before creating any resources. Resources that
50
+ * are associated with a true condition are created. Resources that are
51
+ * associated with a false condition are ignored. AWS CloudFormation also
52
+ * re-evaluates these conditions at each stack update before updating any
53
+ * resources. Resources that are still associated with a true condition are
54
+ * updated. Resources that are now associated with a false condition are
55
+ * deleted.
56
+ *
57
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html}
58
+ */
59
+ Conditions?: TemplateMap<ConditionFunction> | undefined;
60
+ /**
61
+ * The optional `Mappings` section matches a key to a corresponding set of
62
+ * named values. For example, if you want to set values based on a region, you
63
+ * can create a mapping that uses the region name as a key and contains the
64
+ * values you want to specify for each specific region. You use the
65
+ * `Fn::FindInMap` intrinsic function to retrieve values in a map.
66
+ *
67
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html}
68
+ */
69
+ Mappings?: TemplateMap<MappingDefinition> | undefined;
70
+ /**
71
+ * You can use the optional `Metadata` section to include arbitrary JSON or
72
+ * YAML objects that provide details about the template.
73
+ *
74
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html}
75
+ */
76
+ Metadata?: TemplateMap<unknown> | undefined;
77
+ /**
78
+ * The optional `Outputs` section declares output values that you can import
79
+ * into other stacks (to create cross-stack references), return in response
80
+ * (to describe stack calls), or view on the AWS CloudFormation console. For
81
+ * example, you can output the S3 bucket name for a stack to make the bucket
82
+ * easier to find.
83
+ *
84
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html}
85
+ */
86
+ Outputs?: TemplateMap<OutputDefinition> | undefined;
87
+ /**
88
+ * Use the optional `Parameters` section to customize your templates.
89
+ * Parameters enable you to input custom values to your template each time you
90
+ * create or update a stack.
91
+ *
92
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html}
93
+ */
94
+ Parameters?: TemplateMap<ParameterDefinition> | undefined;
95
+ /**
96
+ * The required `Resources` section declares the AWS resources that you want
97
+ * to include in the stack, such as an Amazon EC2 instance or an Amazon S3
98
+ * bucket.
99
+ *
100
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html}
101
+ */
102
+ Resources: TemplateMap<ResourceType> | undefined;
103
+ /**
104
+ * The optional `Rules` section validates a parameter or a combination of
105
+ * parameters passed to a template during a stack creation or stack update. To
106
+ * use template rules, explicitly declare `Rules` in your template followed by
107
+ * an assertion. Use the rules section to validate parameter values before
108
+ * creating or updating resources.
109
+ *
110
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html}
111
+ */
112
+ Rules?: TemplateMap<RuleDefinition> | undefined;
113
+ };
114
+ /**
115
+ * Keys of the sections in a template.
116
+ */
117
+ export type TemplateSection = Exclude<keyof Template, "AWSTemplateFormatVersion">;
118
+ /**
119
+ * The value type of a template section.
120
+ */
121
+ export type TemplateSectionType<Section extends TemplateSection> = Exclude<Template[Section], undefined>[string];
122
+ /**
123
+ * An object containing all valid TemplateSection values.
124
+ */
125
+ export declare const TemplateSection: {
126
+ [K in TemplateSection]: K;
127
+ };
128
+ /**
129
+ * A key-value map.
130
+ */
131
+ export type TemplateMap<T> = Record<string, T>;
132
+ /**
133
+ * The optional `Mappings` section matches a key to a corresponding set of
134
+ * named values. For example, if you want to set values based on a region, you
135
+ * can create a mapping that uses the region name as a key and contains the
136
+ * values you want to specify for each specific region. You use the
137
+ * `Fn::FindInMap` intrinsic function to retrieve values in a map.
138
+ *
139
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html}
140
+ */
141
+ export type MappingDefinition<TopLevelKey extends string = string, SecondLevelKey extends string = string, Value = unknown> = Record<TopLevelKey, Record<SecondLevelKey, Value>>;
142
+ /**
143
+ * The name of the resource output to be exported for a cross-stack reference.
144
+ *
145
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html}
146
+ */
147
+ export type OutputExport = {
148
+ Name: string | ValueFn<string>;
149
+ };
150
+ /**
151
+ * The optional `Outputs` section declares output values that you can import
152
+ * into other stacks (to create cross-stack references), return in response (to
153
+ * describe stack calls), or view on the AWS CloudFormation console. For
154
+ * example, you can output the S3 bucket name for a stack to make the bucket
155
+ * easier to find.
156
+ *
157
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html}
158
+ */
159
+ export type OutputDefinition = {
160
+ /**
161
+ * A String type that describes the output value. The value for the
162
+ * description declaration must be a literal string that's between `0` and
163
+ * `1024` bytes in length. You can't use a parameter or function to specify
164
+ * the description. The description can be a maximum of 4 K in length.
165
+ */
166
+ Description?: string | ValueFn<string> | undefined;
167
+ /**
168
+ * The name of the resource output to be exported for a cross-stack reference.
169
+ */
170
+ Export?: OutputExport | undefined;
171
+ /**
172
+ * The value of the property returned by the aws `cloudformation
173
+ * describe-stacks` command. The value of an output can include literals,
174
+ * parameter references, pseudo-parameters, a mapping value, or intrinsic
175
+ * functions.
176
+ */
177
+ Value: unknown;
178
+ };
179
+ /**
180
+ * Parameters enable you to input custom values to your template each time you
181
+ * create or update a stack.
182
+ *
183
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#parameters-section-structure-properties}
184
+ */
185
+ export type ParameterDefinition<T extends ParameterType = ParameterType> = {
186
+ /**
187
+ * A regular expression that represents the patterns to allow for String
188
+ * types. The pattern must match the entire parameter value provided.
189
+ */
190
+ AllowedPattern?: string | undefined;
191
+ /**
192
+ * An array containing the list of values allowed for the parameter.
193
+ */
194
+ AllowedValues?: string[] | undefined;
195
+ /**
196
+ * A string that explains a constraint when the constraint is violated. For
197
+ * example, without a constraint description, a parameter that has an allowed
198
+ * pattern of `[A-Za-z0-9]+` displays the following error message when the
199
+ * user specifies an invalid value:
200
+ *
201
+ * > Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+
202
+ *
203
+ * By adding a constraint description, such as must only contain letters
204
+ * (uppercase and lowercase) and numbers, you can display the following
205
+ * customized error message:
206
+ *
207
+ * > Malformed input-Parameter MyParameter must only contain uppercase and
208
+ * > lowercase letters and numbers
209
+ */
210
+ ConstraintDescription?: string | undefined;
211
+ /**
212
+ * A value of the appropriate type for the template to use if no value is
213
+ * specified when a stack is created. If you define constraints for the
214
+ * parameter, you must specify a value that adheres to those constraints.
215
+ */
216
+ Default?: string | undefined;
217
+ /**
218
+ * A string of up to 4000 characters that describes the parameter.
219
+ */
220
+ Description?: string | undefined;
221
+ /**
222
+ * An integer value that determines the largest number of characters you want
223
+ * to allow for `String` types.
224
+ */
225
+ MaxLength?: number | undefined;
226
+ /**
227
+ * A numeric value that determines the largest numeric value you want to allow
228
+ * for `Number` types.
229
+ */
230
+ MaxValue?: number | undefined;
231
+ /**
232
+ * An integer value that determines the smallest number of characters you want
233
+ * to allow for `String` types.
234
+ */
235
+ MinLength?: number | undefined;
236
+ /**
237
+ * A numeric value that determines the smallest numeric value you want to
238
+ * allow for `Number` types.
239
+ */
240
+ MinValue?: number | undefined;
241
+ /**
242
+ * Whether to mask the parameter value to prevent it from being displayed in
243
+ * the console, command line tools, or API. If you set the NoEcho attribute to
244
+ * true, CloudFormation returns the parameter value masked as asterisks
245
+ * `(*****)` for any calls that describe the stack or stack events, except for
246
+ * information stored in the locations specified below.
247
+ */
248
+ NoEcho?: boolean | undefined;
249
+ /**
250
+ * The data type for the parameter. See AWS documentation for
251
+ * more info.
252
+ *
253
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#parameters-section-structure-properties}
254
+ */
255
+ Type: T;
256
+ };
257
+ /**
258
+ * Represents the additional options for a resource definition (other than
259
+ * `Type` and Properties.)
260
+ *
261
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html}
262
+ */
263
+ export type ResourceOptions = {
264
+ /**
265
+ * The name of a condition to associate with the resource. The resource will
266
+ * only be created if the condition evaluates to true.
267
+ *
268
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html}
269
+ */
270
+ Condition?: string | undefined;
271
+ /**
272
+ * Associate the `CreationPolicy` attribute with a resource to prevent its
273
+ * status from reaching create complete until AWS CloudFormation receives a
274
+ * specified number of success signals or the timeout period is exceeded. To
275
+ * signal a resource, you can use the `cfn-signal` helper script or
276
+ * [SignalResource
277
+ * API](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SignalResource.html).
278
+ * CloudFormation publishes valid signals to the stack events so that you
279
+ * track the number of signals sent.
280
+ *
281
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html}
282
+ */
283
+ CreationPolicy?: CreationPolicy | undefined;
284
+ /**
285
+ * With the `DeletionPolicy` attribute you can preserve, and in some cases,
286
+ * backup a resource when its stack is deleted. You specify a `DeletionPolicy`
287
+ * attribute for each resource that you want to control. If a resource has no
288
+ * `DeletionPolicy` attribute, AWS CloudFormation deletes the resource by
289
+ * default, except for:
290
+ *
291
+ * - For `AWS::RDS::DBCluster resources`, the default policy is `Snapshot`.
292
+ * - For `AWS::RDS::DBInstance` resources that don't specify the
293
+ * `DBClusterIdentifier` property, the default policy is `Snapshot`.
294
+ * - For Amazon S3 buckets, you must delete all objects in the bucket for
295
+ * deletion to succeed.
296
+ *
297
+ * This capability also applies to stack update operations that lead to
298
+ * resources being deleted from stacks. For example, if you remove the
299
+ * resource from the stack template, and then update the stack with the
300
+ * template. This capability doesn't apply to resources whose physical
301
+ * instance is replaced during stack update operations. For example, if you
302
+ * edit a resource's properties such that CloudFormation replaces that
303
+ * resource during a stack update.
304
+ *
305
+ * To keep a resource when its stack is deleted, specify Retain for that
306
+ * resource. You can use retain for any resource. For example, you can retain
307
+ * a nested stack, Amazon S3 bucket, or EC2 instance so that you can continue
308
+ * to use or modify those resources after you delete their stacks.
309
+ *
310
+ * For resources that support snapshots, such as `AWS::EC2::Volume`, specify
311
+ * Snapshot to have CloudFormation create a snapshot before deleting the
312
+ * resource.
313
+ *
314
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html}
315
+ */
316
+ DeletionPolicy?: DeletionPolicy | FnFindInMap<DeletionPolicy> | FnIf<DeletionPolicy> | Ref<DeletionPolicy> | undefined;
317
+ /**
318
+ * With the `DependsOn` attribute you can specify that the creation of a
319
+ * specific resource follows another. When you add a `DependsOn` attribute to
320
+ * a resource, that resource is created only after the creation of the
321
+ * resource specified in the `DependsOn` attribute.
322
+ *
323
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html}
324
+ */
325
+ DependsOn?: string[] | undefined;
326
+ /**
327
+ * The metadata attribute enables you to associate structured data with a
328
+ * resource. By adding a metadata attribute to a resource, you can add data in
329
+ * JSON or YAML to the resource declaration. In addition, you can use
330
+ * intrinsic functions (such as `GetAtt` and `Ref`), parameters, and pseudo
331
+ * parameters within the metadata attribute to add those interpreted values.
332
+ *
333
+ * AWS CloudFormation doesn't validate the syntax within the metadata
334
+ * attribute.
335
+ *
336
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html}
337
+ */
338
+ Metadata?: TemplateMap<unknown> | undefined;
339
+ /**
340
+ * Use the `UpdatePolicy` attribute to specify how AWS CloudFormation handles
341
+ * updates to the `AWS::AppStream::Fleet`,
342
+ * `AWS::AutoScaling::AutoScalingGroup`, `AWS::ElastiCache::ReplicationGroup`,
343
+ * `AWS::OpenSearchService::Domain`, `AWS::Elasticsearch::Domain`, or
344
+ * `AWS::Lambda::Alias resources`.
345
+ *
346
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html}
347
+ */
348
+ UpdatePolicy?: UpdatePolicy | undefined;
349
+ /**
350
+ * Use the UpdateReplacePolicy attribute to retain or, in some cases, backup
351
+ * the existing physical instance of a resource when it's replaced during a
352
+ * stack update operation.
353
+ *
354
+ * When you initiate a stack update, AWS CloudFormation updates resources
355
+ * based on differences between what you submit and the stack's current
356
+ * template and parameters. If you update a resource property that requires
357
+ * that the resource be replaced, CloudFormation recreates the resource during
358
+ * the update. Recreating the resource generates a new physical ID.
359
+ * CloudFormation creates the replacement resource first, and then changes
360
+ * references from other dependent resources to point to the replacement
361
+ * resource. By default, CloudFormation then deletes the old resource. Using
362
+ * the `UpdateReplacePolicy`, you can specify that CloudFormation retain or,
363
+ * in some cases, create a snapshot of the old resource.
364
+ *
365
+ * For resources that support snapshots, such as `AWS::EC2::Volume`, specify
366
+ * Snapshot to have CloudFormation create a snapshot before deleting the old
367
+ * resource instance.
368
+ *
369
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html}
370
+ */
371
+ UpdateReplacePolicy?: UpdateReplacePolicy | FnFindInMap<UpdateReplacePolicy> | FnIf<UpdateReplacePolicy> | Ref<UpdateReplacePolicy> | undefined;
372
+ };
373
+ /**
374
+ * The required `Resources` section declares the AWS resources that you want to
375
+ * include in the stack, such as an Amazon EC2 instance or an Amazon S3 bucket.
376
+ *
377
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html}
378
+ */
379
+ export type ResourceDefinition<Type extends string = string, Props extends object = Record<string, unknown>> = ResourceOptions & {
380
+ /**
381
+ * Resource properties are additional options that you can specify for a
382
+ * resource.
383
+ *
384
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html}
385
+ */
386
+ Properties: Props;
387
+ /**
388
+ * The resource type identifies the type of resource that you are declaring.
389
+ * For example, `AWS::EC2::Instance` declares an EC2 instance.
390
+ *
391
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html}
392
+ */
393
+ Type: Type;
394
+ };
395
+ /**
396
+ * The required `Resources` section declares the AWS resources that you want to
397
+ * include in the stack, such as an Amazon EC2 instance or an Amazon S3 bucket.
398
+ *
399
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html}
400
+ */
401
+ export type TypedResourceDefinition = {
402
+ [Type in keyof ResourcePropertiesTypeMap]: ResourceDefinition<Type, ResourcePropertiesType<Type>>;
403
+ }[keyof ResourcePropertiesTypeMap];
404
+ /**
405
+ * Extension point for consumers to extend in order to define strongly-typed
406
+ * resource types.
407
+ */
408
+ export interface ResourcePropertiesTypeMap {
409
+ }
410
+ /**
411
+ * Extension point for consumers to extend in order to define strongly-typed
412
+ * resource attribute (output) types.
413
+ */
414
+ export interface ResourceAttributesTypeMap {
415
+ }
416
+ /**
417
+ * A CloudFormation template, with strongly-typed resources. The resource types
418
+ * should be generated with the code generation tool.
419
+ *
420
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html}
421
+ */
422
+ export type FullyTypedTemplate = Template<TypedResourceDefinition>;
423
+ /**
424
+ * Get the properties type for the given resource type.
425
+ */
426
+ export type ResourcePropertiesType<T extends keyof ResourcePropertiesTypeMap> = T extends keyof ResourcePropertiesTypeMap ? ResourcePropertiesTypeMap[T] : never;
427
+ /**
428
+ * Get the attributes type for the given resource type.
429
+ */
430
+ export type ResourceAttributesType<T extends keyof ResourceAttributesTypeMap> = T extends keyof ResourceAttributesTypeMap ? ResourceAttributesTypeMap[T] : never;
431
+ /**
432
+ * Definition for a rule assertion.
433
+ *
434
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html#template-constraint-rules-syntax}
435
+ */
436
+ export type RuleAssertion = {
437
+ /**
438
+ * Rule-specific intrinsic function.
439
+ *
440
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html#rules-specific-intrinsic-section-structure}
441
+ */
442
+ Assert: RuleFunction;
443
+ /**
444
+ * Information about this assert.
445
+ */
446
+ AssertDescription?: string | undefined;
447
+ };
448
+ /**
449
+ * Each template rule consists of two properties:
450
+ *
451
+ * - Rule condition (optional) — determines when a rule takes effect.
452
+ * - Assertions (required) — describes what values users can specify for a
453
+ * particular parameter.
454
+ *
455
+ * A rule can include a `RuleCondition` property and must include an Assertions
456
+ * property. For each rule, you can define only one rule condition. You can
457
+ * define one or more asserts within the `Assertions` property. If you don't
458
+ * define a rule condition, the rule's assertions always take effect.
459
+ *
460
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html#w2ab1c23c15c19b5}
461
+ */
462
+ export type RuleDefinition = {
463
+ /**
464
+ * Describes what values users can specify for a particular parameter.
465
+ */
466
+ Assertions: RuleAssertion[];
467
+ /**
468
+ * Determines when a rule takes effect.
469
+ */
470
+ RuleCondition?: RuleFunction | undefined;
471
+ };
472
+ /**
473
+ * To specify how AWS CloudFormation handles replacement updates for an Auto
474
+ * Scaling group, use the AutoScalingReplacingUpdate policy. This policy enables
475
+ * you to specify whether AWS CloudFormation replaces an Auto Scaling group with
476
+ * a new one or replaces only the instances in the Auto Scaling group.
477
+ *
478
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-replacingupdate}
479
+ */
480
+ export type AutoScalingReplacingUpdatePolicy = {
481
+ /**
482
+ * Specifies whether an Auto Scaling group and the instances it contains are
483
+ * replaced during an update. During replacement, CloudFormation retains the
484
+ * old group until it finishes creating the new one. If the update fails,
485
+ * CloudFormation can roll back to the old Auto Scaling group and delete the
486
+ * new Auto Scaling group.
487
+ *
488
+ * While CloudFormation creates the new group, it doesn't detach or attach any
489
+ * instances. After successfully creating the new Auto Scaling group,
490
+ * CloudFormation deletes the old Auto Scaling group during the cleanup
491
+ * process.
492
+ *
493
+ * When you set the `WillReplace` parameter, remember to specify a matching
494
+ * `CreationPolicy`. If the minimum number of instances (specified by the
495
+ * `MinSuccessfulInstancesPercent` property) don't signal success within the
496
+ * `Timeout` period (specified in the `CreationPolicy` policy), the
497
+ * replacement update fails and AWS CloudFormation rolls back to the old Auto
498
+ * Scaling group.
499
+ */
500
+ WillReplace?: boolean | ValueFn<boolean> | undefined;
501
+ };
502
+ /**
503
+ * To specify how CloudFormation handles rolling updates for an Auto Scaling
504
+ * group, use the `AutoScalingRollingUpdate` policy. Rolling updates enable you
505
+ * to specify whether AWS CloudFormation updates instances that are in an Auto
506
+ * Scaling group in batches or all at once.
507
+ *
508
+ * Be aware that, during stack update rollback operations, CloudFormation uses
509
+ * the `UpdatePolicy` configuration specified in the template before the current
510
+ * stack update operation. For example, suppose you have updated the
511
+ * `MaxBatchSize` in your stack template's `UpdatePolicy` from 1 to 10. You then
512
+ * perform a stack update, and that update fails and CloudFormation initiates an
513
+ * update rollback operation. In such a case, CloudFormation will use 1 as the
514
+ * maximum batch size, rather than 10. For this reason, we recommend you make
515
+ * changes to the UpdatePolicy configuration in a stack update separate from and
516
+ * before any updates to the `AWS::AutoScaling::AutoScalingGroup` resource that
517
+ * are likely to initiate rolling updates.
518
+ *
519
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-rollingupdate}
520
+ */
521
+ export type AutoScalingRollingUpdatePolicy = {
522
+ /**
523
+ * Specifies the maximum number of instances that CloudFormation updates.
524
+ *
525
+ * @default 1
526
+ */
527
+ MaxBatchSize?: number | ValueFn<number> | undefined;
528
+ /**
529
+ * Specifies the minimum number of instances that must be in service within
530
+ * the Auto Scaling group while CloudFormation updates old instances. This
531
+ * value must be less than the `MaxSize` of the Auto Scaling group.\
532
+ *
533
+ * @default 0
534
+ */
535
+ MinInstancesInService?: number | ValueFn<number> | undefined;
536
+ /**
537
+ * Specifies the percentage of instances in an Auto Scaling rolling update
538
+ * that must signal success for an update to succeed. You can specify a value
539
+ * from `0` to `100`. CloudFormation rounds to the nearest tenth of a percent.
540
+ * For example, if you update five instances with a minimum successful
541
+ * percentage of `50`, three instances must signal success.
542
+ *
543
+ * If an instance doesn't send a signal within the time specified in the
544
+ * `PauseTime` property, CloudFormation assumes that the instance wasn't
545
+ * updated.
546
+ *
547
+ * If you specify this property, you must also enable the
548
+ * `WaitOnResourceSignals` and `PauseTime` properties.
549
+ *
550
+ * The `MinSuccessfulInstancesPercent` parameter applies only to instances
551
+ * only for signaling purpose. To specify the number of instances in your
552
+ * autoscaling group, see the `MinSize`, `MaxSize`, and `DesiredCapacity`
553
+ * properties fo the `AWS::AutoScaling::AutoScalingGroup` resource.
554
+ *
555
+ * @default 100
556
+ */
557
+ MinSuccessfulInstancesPercent?: number | ValueFn<number> | undefined;
558
+ /**
559
+ * The amount of time that CloudFormation pauses after making a change to a
560
+ * batch of instances to give those instances time to start software
561
+ * applications. For example, you might need to specify `PauseTime` when
562
+ * scaling up the number of instances in an Auto Scaling group.
563
+ *
564
+ * If you enable the WaitOnResourceSignals property, `PauseTime` is the amount
565
+ * of time that CloudFormation should wait for the Auto Scaling group to
566
+ * receive the required number of valid signals from added or replaced
567
+ * instances. If the `PauseTime` is exceeded before the Auto Scaling group
568
+ * receives the required number of signals, the update fails. For best
569
+ * results, specify a time period that gives your applications sufficient time
570
+ * to get started. If the update needs to be rolled back, a short `PauseTime`
571
+ * can cause the rollback to fail.
572
+ *
573
+ * Specify `PauseTime` in the ISO8601 duration format (in the format
574
+ * `PT#H#M#S`, where each `#` is the number of hours, minutes, and seconds,
575
+ * respectively). The maximum `PauseTime` is one hour (`PT1H`).
576
+ *
577
+ * **Default:** `PT0S` (0 seconds). If the `WaitOnResourceSignals` property is
578
+ * set to true, the default is `PT5M`.
579
+ */
580
+ PauseTime?: string | ValueFn<string> | undefined;
581
+ /**
582
+ * Specifies the Auto Scaling processes to suspend during a stack update.
583
+ * Suspending processes prevents Auto Scaling from interfering with a stack
584
+ * update. For example, you can suspend alarming so that Amazon EC2 Auto
585
+ * Scaling doesn't execute scaling policies associated with an alarm. For
586
+ * valid values, see the `ScalingProcesses.member.N` parameter for the
587
+ * SuspendProcesses action in the Amazon EC2 Auto Scaling API Reference.
588
+ */
589
+ SuspendProcesses?: (string | ValueFn<string>)[] | ValueFn<string[]> | undefined;
590
+ /**
591
+ * Specifies whether the Auto Scaling group waits on signals from new
592
+ * instances during an update. Use this property to ensure that instances have
593
+ * completed installing and configuring applications before the Auto Scaling
594
+ * group update proceeds. AWS CloudFormation suspends the update of an Auto
595
+ * Scaling group after new EC2 instances are launched into the group. AWS
596
+ * CloudFormation must receive a signal from each new instance within the
597
+ * specified PauseTime before continuing the update. To signal the Auto
598
+ * Scaling group, use the `cfn-signal` helper script or SignalResource API.
599
+ *
600
+ * To have instances wait for an Elastic Load Balancing health check before
601
+ * they signal success, add a health-check verification by using the `cfn-init`
602
+ * helper script. For an example, see the `verify_instance_health` command in
603
+ * the Auto Scaling rolling updates sample template.
604
+ *
605
+ * @default false
606
+ */
607
+ WaitOnResourceSignals?: boolean | ValueFn<boolean> | undefined;
608
+ };
609
+ /**
610
+ * To specify how AWS CloudFormation handles updates for the `MinSize`,
611
+ * `MaxSize`, and `DesiredCapacity` properties when the
612
+ * `AWS::AutoScaling::AutoScalingGroup` resource has an associated scheduled
613
+ * action, use the `AutoScalingScheduledAction` policy.
614
+ *
615
+ * With scheduled actions, the group size properties of an Auto Scaling group
616
+ * can change at any time. When you update a stack with an Auto Scaling group
617
+ * and scheduled action, CloudFormation always sets the group size property
618
+ * values of your Auto Scaling group to the values that are defined in the
619
+ * `AWS::AutoScaling::AutoScalingGroup` resource of your template, even if a
620
+ * scheduled action is in effect.
621
+ *
622
+ * If you don't want CloudFormation to change any of the group size property
623
+ * values when you have a scheduled action in effect, use the
624
+ * `AutoScalingScheduledAction` update policy and set
625
+ * `IgnoreUnmodifiedGroupSizeProperties` to true to prevent CloudFormation from
626
+ * changing the `MinSize`, `MaxSize`, or `DesiredCapacity` properties unless you
627
+ * have modified these values in your template.
628
+ *
629
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-scheduledactions}
630
+ */
631
+ export type AutoScalingScheduledActionPolicy = {
632
+ /**
633
+ * If true, AWS CloudFormation ignores differences in group size properties
634
+ * between your current Auto Scaling group and the Auto Scaling group
635
+ * described in the `AWS::AutoScaling::AutoScalingGroup` resource of your
636
+ * template during a stack update. If you modify any of the group size
637
+ * property values in your template, AWS CloudFormation uses the modified
638
+ * values and updates your Auto Scaling group.
639
+ *
640
+ * @default false
641
+ */
642
+ IgnoreUnmodifiedGroupSizeProperties?: boolean | undefined;
643
+ };
644
+ /**
645
+ * To perform an CodeDeploy deployment when the version changes on an
646
+ * `AWS::Lambda::Alias` resource, use the `CodeDeployLambdaAliasUpdate` update
647
+ * policy.
648
+ *
649
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-codedeploylambdaaliasupdate}
650
+ */
651
+ export type CodeDeployLambdaAliasUpdatePolicy = {
652
+ /**
653
+ * The name of the Lambda function to run after traffic routing completes.
654
+ */
655
+ AfterAllowTrafficHook?: string | ValueFn<string> | undefined;
656
+ /**
657
+ * The name of the CodeDeploy application.
658
+ */
659
+ ApplicationName: string | ValueFn<string> | undefined;
660
+ /**
661
+ * The name of the Lambda function to run before traffic routing starts.
662
+ */
663
+ BeforeAllowTrafficHook?: string | ValueFn<string> | undefined;
664
+ /**
665
+ * The name of the CodeDeploy deployment group. This is where the
666
+ * traffic-shifting policy is set.
667
+ */
668
+ DeploymentGroupName: string | ValueFn<string> | undefined;
669
+ };
670
+ /**
671
+ * For an Auto Scaling group replacement update, specifies how many instances
672
+ * must signal success for the update to succeed.
673
+ *
674
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html}
675
+ */
676
+ export type AutoScalingCreationPolicy = {
677
+ /**
678
+ * Specifies the percentage of instances in an Auto Scaling replacement update
679
+ * that must signal success for the update to succeed. You can specify a value
680
+ * from `0` to `100`. CloudFormation rounds to the nearest tenth of a percent.
681
+ * For example, if you update five instances with a minimum successful
682
+ * percentage of `50`, three instances must signal success. If an instance
683
+ * doesn't send a signal within the time specified by the Timeout property,
684
+ * CloudFormation assumes that the instance wasn't created.
685
+ */
686
+ MinSuccessfulInstancesPercent?: number | ValueFn<number> | undefined;
687
+ };
688
+ /**
689
+ * When CloudFormation creates the associated resource, configures the number of
690
+ * required success signals and the length of time that CloudFormation waits for
691
+ * those signals.
692
+ *
693
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html}
694
+ */
695
+ export type ResourceSignalPolicy = {
696
+ /**
697
+ * The number of success signals CloudFormation must receive before it sets
698
+ * the resource status as `CREATE_COMPLETE`. If the resource receives a
699
+ * failure signal or doesn't receive the specified number of signals before
700
+ * the timeout period expires, the resource creation fails and CloudFormation
701
+ * rolls the stack back.
702
+ */
703
+ Count?: number | ValueFn<number> | undefined;
704
+ /**
705
+ * The length of time that CloudFormation waits for the number of signals that
706
+ * was specified in the Count property. The timeout period starts after
707
+ * CloudFormation starts creating the resource, and the timeout expires no
708
+ * sooner than the time you specify but can occur shortly thereafter. The
709
+ * maximum time that you can specify is 12 hours.
710
+ *
711
+ * The value must be in ISO8601 duration format, in the form: `"PT#H#M#S"`,
712
+ * where each # is the number of hours, minutes, and seconds, respectively.
713
+ * For best results, specify a period of time that gives your instances plenty
714
+ * of time to get up and running. A shorter timeout can cause a rollback.
715
+ */
716
+ Timeout?: string | ValueFn<string> | undefined;
717
+ };
718
+ /**
719
+ * Associate the `CreationPolicy` attribute with a resource to prevent its
720
+ * status from reaching create complete until AWS CloudFormation receives a
721
+ * specified number of success signals or the timeout period is exceeded. To
722
+ * signal a resource, you can use the `cfn-signal` helper script or
723
+ * SignalResource API. CloudFormation publishes valid signals to the stack
724
+ * events so that you track the number of signals sent.
725
+ *
726
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html}
727
+ */
728
+ export type CreationPolicy = {
729
+ /**
730
+ * For an Auto Scaling group replacement update, specifies how many instances
731
+ * must signal success for the update to succeed.
732
+ */
733
+ AutoScalingCreationPolicy?: AutoScalingCreationPolicy | undefined;
734
+ /**
735
+ * When CloudFormation creates the associated resource, configures the number
736
+ * of required success signals and the length of time that CloudFormation
737
+ * waits for those signals.
738
+ */
739
+ ResourceSignal?: ResourceSignalPolicy | undefined;
740
+ };
741
+ /**
742
+ * With the `DeletionPolicy` attribute you can preserve, and in some cases,
743
+ * backup a resource when its stack is deleted. You specify a `DeletionPolicy`
744
+ * attribute for each resource that you want to control. If a resource has no
745
+ * `DeletionPolicy` attribute, AWS CloudFormation deletes the resource by
746
+ * default, except for:
747
+ *
748
+ * - For `AWS::RDS::DBCluster resources`, the default policy is `Snapshot`.
749
+ * - For `AWS::RDS::DBInstance` resources that don't specify the
750
+ * `DBClusterIdentifier` property, the default policy is `Snapshot`.
751
+ * - For Amazon S3 buckets, you must delete all objects in the bucket for
752
+ * deletion to succeed.
753
+ *
754
+ * This capability also applies to stack update operations that lead to
755
+ * resources being deleted from stacks. For example, if you remove the resource
756
+ * from the stack template, and then update the stack with the template. This
757
+ * capability doesn't apply to resources whose physical instance is replaced
758
+ * during stack update operations. For example, if you edit a resource's
759
+ * properties such that CloudFormation replaces that resource during a stack
760
+ * update.
761
+ *
762
+ * To keep a resource when its stack is deleted, specify Retain for that
763
+ * resource. You can use retain for any resource. For example, you can retain a
764
+ * nested stack, Amazon S3 bucket, or EC2 instance so that you can continue to
765
+ * use or modify those resources after you delete their stacks.
766
+ *
767
+ * For resources that support snapshots, such as `AWS::EC2::Volume`, specify
768
+ * Snapshot to have CloudFormation create a snapshot before deleting the
769
+ * resource.
770
+ *
771
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html}
772
+ */
773
+ export type DeletionPolicy = "Delete" | "Retain" | "Snapshot";
774
+ /**
775
+ * Use the UpdateReplacePolicy attribute to retain or, in some cases, backup the
776
+ * existing physical instance of a resource when it's replaced during a stack
777
+ * update operation.
778
+ *
779
+ * When you initiate a stack update, AWS CloudFormation updates resources based
780
+ * on differences between what you submit and the stack's current template and
781
+ * parameters. If you update a resource property that requires that the resource
782
+ * be replaced, CloudFormation recreates the resource during the update.
783
+ * Recreating the resource generates a new physical ID. CloudFormation creates
784
+ * the replacement resource first, and then changes references from other
785
+ * dependent resources to point to the replacement resource. By default,
786
+ * CloudFormation then deletes the old resource. Using the UpdateReplacePolicy,
787
+ * you can specify that CloudFormation retain or, in some cases, create a
788
+ * snapshot of the old resource.
789
+ *
790
+ * For resources that support snapshots, such as `AWS::EC2::Volume`, specify
791
+ * Snapshot to have CloudFormation create a snapshot before deleting the old
792
+ * resource instance.
793
+ *
794
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html}
795
+ */
796
+ export type UpdateReplacePolicy = "Delete" | "Retain" | "Snapshot";
797
+ /**
798
+ * Use the `UpdatePolicy` attribute to specify how AWS CloudFormation handles
799
+ * updates to the `AWS::AppStream::Fleet`,
800
+ * `AWS::AutoScaling::AutoScalingGroup`, ``AWS::ElastiCache::ReplicationGroup``,
801
+ * `AWS::OpenSearchService::Domain`, `AWS::Elasticsearch::Domain`, or
802
+ * `AWS::Lambda::Alias resources`.
803
+ *
804
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html}
805
+ */
806
+ export type UpdatePolicy = {
807
+ /**
808
+ * To specify how AWS CloudFormation handles replacement updates for an Auto
809
+ * Scaling group, use the AutoScalingReplacingUpdate policy. This policy
810
+ * enables you to specify whether AWS CloudFormation replaces an Auto Scaling
811
+ * group with a new one or replaces only the instances in the Auto Scaling
812
+ * group.
813
+ *
814
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-replacingupdate}
815
+ */
816
+ AutoScalingReplacing?: AutoScalingReplacingUpdatePolicy | undefined;
817
+ /**
818
+ * To specify how CloudFormation handles rolling updates for an Auto Scaling
819
+ * group, use the `AutoScalingRollingUpdate` policy. Rolling updates enable
820
+ * you to specify whether AWS CloudFormation updates instances that are in an
821
+ * Auto Scaling group in batches or all at once.
822
+ *
823
+ * Be aware that, during stack update rollback operations, CloudFormation uses
824
+ * the `UpdatePolicy` configuration specified in the template before the
825
+ * current stack update operation. For example, suppose you have updated the
826
+ * `MaxBatchSize` in your stack template's `UpdatePolicy` from 1 to 10. You
827
+ * then perform a stack update, and that update fails and CloudFormation
828
+ * initiates an update rollback operation. In such a case, CloudFormation will
829
+ * use 1 as the maximum batch size, rather than 10. For this reason, we
830
+ * recommend you make changes to the UpdatePolicy configuration in a stack
831
+ * update separate from and before any updates to the
832
+ * `AWS::AutoScaling::AutoScalingGroup` resource that are likely to initiate
833
+ * rolling updates.
834
+ *
835
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-rollingupdate}
836
+ */
837
+ AutoScalingRollingUpdate?: AutoScalingRollingUpdatePolicy | undefined;
838
+ /**
839
+ * To specify how AWS CloudFormation handles updates for the `MinSize`,
840
+ * `MaxSize`, and `DesiredCapacity` properties when the
841
+ * `AWS::AutoScaling::AutoScalingGroup` resource has an associated scheduled
842
+ * action, use the `AutoScalingScheduledAction` policy.
843
+ *
844
+ * With scheduled actions, the group size properties of an Auto Scaling group
845
+ * can change at any time. When you update a stack with an Auto Scaling group
846
+ * and scheduled action, CloudFormation always sets the group size property
847
+ * values of your Auto Scaling group to the values that are defined in the
848
+ * `AWS::AutoScaling::AutoScalingGroup` resource of your template, even if a
849
+ * scheduled action is in effect.
850
+ *
851
+ * If you don't want CloudFormation to change any of the group size property
852
+ * values when you have a scheduled action in effect, use the
853
+ * `AutoScalingScheduledAction` update policy and set
854
+ * `IgnoreUnmodifiedGroupSizeProperties` to true to prevent CloudFormation
855
+ * from changing the `MinSize`, `MaxSize`, or `DesiredCapacity` properties
856
+ * unless you have modified these values in your template.
857
+ *
858
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-scheduledactions}
859
+ */
860
+ AutoScalingScheduledAction?: AutoScalingScheduledActionPolicy | undefined;
861
+ /**
862
+ * To perform an CodeDeploy deployment when the version changes on an
863
+ * `AWS::Lambda::Alias` resource, use the `CodeDeployLambdaAliasUpdate` update
864
+ * policy.
865
+ *
866
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-codedeploylambdaaliasupdate}
867
+ */
868
+ CodeDeployLambdaAliasUpdate?: CodeDeployLambdaAliasUpdatePolicy | undefined;
869
+ /**
870
+ * To upgrade an OpenSearch Service domain to a new version of OpenSearch or
871
+ * Elasticsearch rather than replacing the entire
872
+ * `AWS::OpenSearchService::Domain` or `AWS::Elasticsearch::Domain` resource, use
873
+ * the `EnableVersionUpgrade` update policy.
874
+ *
875
+ * If `EnableVersionUpgrade` is set to true, you can update the `EngineVersion`
876
+ * property of the `AWS::OpenSearchService::Domain` resource (or the
877
+ * `ElasticsearchVersion` property of the legacy `AWS::Elasticsearch::Domain`
878
+ * resource), and CloudFormation will update that property without
879
+ * interruption. When `EnableVersionUpgrade` is set to false, or not specified,
880
+ * updating the `EngineVersion` or `ElasticsearchVersion` property results in
881
+ * CloudFormation replacing the entire
882
+ * `AWS::OpenSearchService::Domain`/`AWS::Elasticsearch::Domain` resource.
883
+ *
884
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-upgradeopensearchdomain}
885
+ */
886
+ EnableVersionUpgrade?: boolean | ValueFn<boolean> | undefined;
887
+ /**
888
+ * To modify a replication group's shards by adding or removing shards, rather
889
+ * than replacing the entire `AWS::ElastiCache::ReplicationGroup` resource,
890
+ * use the `UseOnlineResharding` update policy.
891
+ *
892
+ * If `UseOnlineResharding` is set to true, you can update the `NumNodeGroups`
893
+ * and `NodeGroupConfiguration` properties of the
894
+ * `AWS::ElastiCache::ReplicationGroup` resource, and CloudFormation will
895
+ * update those properties without interruption. When `UseOnlineResharding` is
896
+ * set to false, or not specified, updating the `NumNodeGroups` and
897
+ * `NodeGroupConfiguration` properties results in CloudFormation replacing the
898
+ * entire `AWS::ElastiCache::ReplicationGroup` resource.
899
+ *
900
+ * @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-useonlineresharding}
901
+ */
902
+ UseOnlineResharding?: boolean | ValueFn<boolean> | undefined;
903
+ };
904
+ //# sourceMappingURL=template.d.ts.map