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