@awboost/cfntypes 1.0.0-beta.4 → 1.0.0-beta.41
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/lib/AutoScalingReplacingUpdatePolicy.d.ts +30 -0
- package/lib/AutoScalingReplacingUpdatePolicy.js +1 -0
- package/lib/AutoScalingRollingUpdatePolicy.d.ts +107 -0
- package/lib/AutoScalingRollingUpdatePolicy.js +20 -0
- package/lib/AutoScalingScheduledActionPolicy.d.ts +35 -0
- package/lib/AutoScalingScheduledActionPolicy.js +23 -0
- package/lib/AwsParam.d.ts +73 -0
- package/lib/AwsParam.js +89 -0
- package/lib/CodeDeployLambdaAliasUpdatePolicy.d.ts +26 -0
- package/lib/CodeDeployLambdaAliasUpdatePolicy.js +1 -0
- package/lib/CreationPolicy.d.ts +71 -0
- package/lib/CreationPolicy.js +1 -0
- package/lib/DeletionPolicy.d.ts +84 -0
- package/lib/DeletionPolicy.js +83 -0
- package/lib/Fn.d.ts +356 -0
- package/lib/Fn.js +410 -0
- package/lib/OutputDefinition.d.ts +38 -0
- package/lib/OutputDefinition.js +1 -0
- package/lib/ParameterDefinition.d.ts +78 -0
- package/lib/ParameterDefinition.js +1 -0
- package/lib/ResourceDefinition.d.ts +197 -0
- package/lib/ResourceDefinition.js +1 -0
- package/lib/RuleDefinition.d.ts +43 -0
- package/lib/RuleDefinition.js +1 -0
- package/lib/Template.d.ts +117 -0
- package/lib/Template.js +1 -0
- package/lib/TemplateMap.d.ts +6 -0
- package/lib/TemplateMap.js +1 -0
- package/lib/UpdatePolicy.d.ts +111 -0
- package/lib/UpdatePolicy.js +1 -0
- package/lib/cjs/AutoScalingReplacingUpdatePolicy.js +2 -0
- package/lib/cjs/AutoScalingRollingUpdatePolicy.js +21 -0
- package/lib/cjs/AutoScalingScheduledActionPolicy.js +24 -0
- package/lib/cjs/AwsParam.js +93 -0
- package/lib/cjs/CodeDeployLambdaAliasUpdatePolicy.js +2 -0
- package/lib/cjs/CreationPolicy.js +2 -0
- package/lib/cjs/DeletionPolicy.js +86 -0
- package/lib/cjs/Fn.js +414 -0
- package/lib/cjs/OutputDefinition.js +2 -0
- package/lib/cjs/ParameterDefinition.js +2 -0
- package/lib/cjs/ResourceDefinition.js +2 -0
- package/lib/cjs/RuleDefinition.js +2 -0
- package/lib/cjs/Template.js +2 -0
- package/lib/cjs/TemplateMap.js +2 -0
- package/lib/cjs/UpdatePolicy.js +2 -0
- package/lib/cjs/index.js +33 -0
- package/lib/cjs/types.generated.js +2280 -0
- package/lib/index.d.ts +16 -61748
- package/lib/index.js +17 -2055
- package/lib/types.generated.d.ts +90209 -0
- package/lib/types.generated.js +2277 -0
- package/package.json +12 -8
- package/lib/index-cjs.js +0 -2058
@@ -0,0 +1,197 @@
|
|
1
|
+
import { CreationPolicy } from './CreationPolicy.js';
|
2
|
+
import { DeletionPolicy } from './DeletionPolicy.js';
|
3
|
+
import { IntrinsicValue } from './Fn.js';
|
4
|
+
import { TemplateMap } from './TemplateMap.js';
|
5
|
+
import { ResourceType, ResourceTypes } from './types.generated.js';
|
6
|
+
import { UpdatePolicy } from './UpdatePolicy.js';
|
7
|
+
/**
|
8
|
+
* Represents the additional options for a resource definition (other than
|
9
|
+
* `Type` and Properties.)
|
10
|
+
*
|
11
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html | AWS resource and property types reference}
|
12
|
+
*/
|
13
|
+
export interface ResourceOptions {
|
14
|
+
/**
|
15
|
+
* The name of a condition to associate with the resource. The resource will
|
16
|
+
* only be created if the condition evaluates to true.
|
17
|
+
*
|
18
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html | Conditions}
|
19
|
+
*/
|
20
|
+
Condition?: string;
|
21
|
+
/**
|
22
|
+
* Associate the `CreationPolicy` attribute with a resource to prevent its
|
23
|
+
* status from reaching create complete until AWS CloudFormation receives a
|
24
|
+
* specified number of success signals or the timeout period is exceeded. To
|
25
|
+
* signal a resource, you can use the `cfn-signal` helper script or
|
26
|
+
* [SignalResource
|
27
|
+
* API](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SignalResource.html).
|
28
|
+
* CloudFormation publishes valid signals to the stack events so that you
|
29
|
+
* track the number of signals sent.
|
30
|
+
*
|
31
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html | CreationPolicy attribute}
|
32
|
+
*/
|
33
|
+
CreationPolicy?: CreationPolicy;
|
34
|
+
/**
|
35
|
+
* With the `DeletionPolicy` attribute you can preserve, and in some cases,
|
36
|
+
* backup a resource when its stack is deleted. You specify a `DeletionPolicy`
|
37
|
+
* attribute for each resource that you want to control. If a resource has no
|
38
|
+
* `DeletionPolicy` attribute, AWS CloudFormation deletes the resource by
|
39
|
+
* default, except for:
|
40
|
+
*
|
41
|
+
* - For `AWS::RDS::DBCluster resources`, the default policy is `Snapshot`.
|
42
|
+
* - For `AWS::RDS::DBInstance` resources that don't specify the
|
43
|
+
* `DBClusterIdentifier` property, the default policy is `Snapshot`.
|
44
|
+
* - For Amazon S3 buckets, you must delete all objects in the bucket for
|
45
|
+
* deletion to succeed.
|
46
|
+
*
|
47
|
+
* This capability also applies to stack update operations that lead to
|
48
|
+
* resources being deleted from stacks. For example, if you remove the
|
49
|
+
* resource from the stack template, and then update the stack with the
|
50
|
+
* template. This capability doesn't apply to resources whose physical
|
51
|
+
* instance is replaced during stack update operations. For example, if you
|
52
|
+
* edit a resource's properties such that CloudFormation replaces that
|
53
|
+
* resource during a stack update.
|
54
|
+
*
|
55
|
+
* To keep a resource when its stack is deleted, specify Retain for that
|
56
|
+
* resource. You can use retain for any resource. For example, you can retain
|
57
|
+
* a nested stack, Amazon S3 bucket, or EC2 instance so that you can continue
|
58
|
+
* to use or modify those resources after you delete their stacks.
|
59
|
+
*
|
60
|
+
* For resources that support snapshots, such as `AWS::EC2::Volume`, specify
|
61
|
+
* Snapshot to have CloudFormation create a snapshot before deleting the
|
62
|
+
* resource.
|
63
|
+
*
|
64
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html | DeletionPolicy attribute}
|
65
|
+
*/
|
66
|
+
DeletionPolicy?: DeletionPolicy;
|
67
|
+
/**
|
68
|
+
* With the `DependsOn` attribute you can specify that the creation of a
|
69
|
+
* specific resource follows another. When you add a `DependsOn` attribute to
|
70
|
+
* a resource, that resource is created only after the creation of the
|
71
|
+
* resource specified in the `DependsOn` attribute.
|
72
|
+
*
|
73
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html | DependsOn attribute}
|
74
|
+
*/
|
75
|
+
DependsOn?: string[];
|
76
|
+
/**
|
77
|
+
* The metadata attribute enables you to associate structured data with a
|
78
|
+
* resource. By adding a metadata attribute to a resource, you can add data in
|
79
|
+
* JSON or YAML to the resource declaration. In addition, you can use
|
80
|
+
* intrinsic functions (such as `GetAtt` and `Ref`), parameters, and pseudo
|
81
|
+
* parameters within the metadata attribute to add those interpreted values.
|
82
|
+
*
|
83
|
+
* AWS CloudFormation doesn't validate the syntax within the metadata
|
84
|
+
* attribute.
|
85
|
+
*
|
86
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html | Metadata attribute}
|
87
|
+
*/
|
88
|
+
Metadata?: TemplateMap<IntrinsicValue>;
|
89
|
+
/**
|
90
|
+
* Use the `UpdatePolicy` attribute to specify how AWS CloudFormation handles
|
91
|
+
* updates to the `AWS::AppStream::Fleet`,
|
92
|
+
* `AWS::AutoScaling::AutoScalingGroup`, `AWS::ElastiCache::ReplicationGroup`,
|
93
|
+
* `AWS::OpenSearchService::Domain`, `AWS::Elasticsearch::Domain`, or
|
94
|
+
* `AWS::Lambda::Alias resources`.
|
95
|
+
*
|
96
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html | UpdatePolicy attribute}
|
97
|
+
*/
|
98
|
+
UpdatePolicy?: UpdatePolicy;
|
99
|
+
/**
|
100
|
+
* Use the UpdateReplacePolicy attribute to retain or, in some cases, backup
|
101
|
+
* the existing physical instance of a resource when it's replaced during a
|
102
|
+
* stack update operation.
|
103
|
+
*
|
104
|
+
* When you initiate a stack update, AWS CloudFormation updates resources
|
105
|
+
* based on differences between what you submit and the stack's current
|
106
|
+
* template and parameters. If you update a resource property that requires
|
107
|
+
* that the resource be replaced, CloudFormation recreates the resource during
|
108
|
+
* the update. Recreating the resource generates a new physical ID.
|
109
|
+
* CloudFormation creates the replacement resource first, and then changes
|
110
|
+
* references from other dependent resources to point to the replacement
|
111
|
+
* resource. By default, CloudFormation then deletes the old resource. Using
|
112
|
+
* the `UpdateReplacePolicy`, you can specify that CloudFormation retain or,
|
113
|
+
* in some cases, create a snapshot of the old resource.
|
114
|
+
*
|
115
|
+
* For resources that support snapshots, such as `AWS::EC2::Volume`, specify
|
116
|
+
* Snapshot to have CloudFormation create a snapshot before deleting the old
|
117
|
+
* resource instance.
|
118
|
+
*
|
119
|
+
* You can apply the `UpdateReplacePolicy` attribute to any resource.
|
120
|
+
* `UpdateReplacePolicy` is only executed if you update a resource property
|
121
|
+
* whose update behavior is specified as Replacement, thereby causing
|
122
|
+
* CloudFormation to replace the old resource with a new one with a new
|
123
|
+
* physical ID. For example, if you update the Engine property of an
|
124
|
+
* `AWS::RDS::DBInstance` resource type, CloudFormation creates a new resource
|
125
|
+
* and replaces the current DB instance resource with the new one. The
|
126
|
+
* `UpdateReplacePolicy` attribute would then dictate whether CloudFormation
|
127
|
+
* deleted, retained, or created a snapshot of the old DB instance. The update
|
128
|
+
* behavior for each property of a resource is specified in the reference
|
129
|
+
* topic for that resource in the AWS resource and property types reference.
|
130
|
+
* For more information on resource update behavior, see Update behaviors of
|
131
|
+
* stack resources.
|
132
|
+
*
|
133
|
+
* The `UpdateReplacePolicy` attribute applies to stack updates you perform
|
134
|
+
* directly, in addition to stack updates performed using change sets.
|
135
|
+
*
|
136
|
+
* `UpdateReplacePolicy` differs from the `DeletionPolicy` attribute in that
|
137
|
+
* it only applies to resources replaced during stack updates. Use
|
138
|
+
* `DeletionPolicy` for resources deleted when a stack is deleted, or when the
|
139
|
+
* resource definition itself is deleted from the template as part of a stack
|
140
|
+
* update.
|
141
|
+
*
|
142
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html | UpdateReplacePolicy attribute}
|
143
|
+
*/
|
144
|
+
UpdateReplacePolicy?: DeletionPolicy;
|
145
|
+
}
|
146
|
+
/**
|
147
|
+
* The required `Resources` section declares the AWS resources that you want to
|
148
|
+
* include in the stack, such as an Amazon EC2 instance or an Amazon S3 bucket.
|
149
|
+
*
|
150
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html | AWS resource and property types reference}
|
151
|
+
*/
|
152
|
+
export interface ResourceDefinitionBase<P = unknown, T = string> extends ResourceOptions {
|
153
|
+
/**
|
154
|
+
* Resource properties are additional options that you can specify for a
|
155
|
+
* resource.
|
156
|
+
*
|
157
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html | AWS resource and property types reference}
|
158
|
+
*/
|
159
|
+
Properties: P;
|
160
|
+
/**
|
161
|
+
* The resource type identifies the type of resource that you are declaring.
|
162
|
+
* For example, `AWS::EC2::Instance` declares an EC2 instance.
|
163
|
+
*
|
164
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html | AWS resource and property types reference}
|
165
|
+
*/
|
166
|
+
Type: T;
|
167
|
+
}
|
168
|
+
/**
|
169
|
+
* Represents a built-in AWS resource definition.
|
170
|
+
*/
|
171
|
+
export type AwsResourceDefinitionType<T extends ResourceType> = ResourceDefinitionBase<ResourceTypes[T], T>;
|
172
|
+
/**
|
173
|
+
* Represents the set of all resource definition types.
|
174
|
+
*/
|
175
|
+
export type AwsResourceDefinition = {
|
176
|
+
[K in ResourceType]: AwsResourceDefinitionType<K>;
|
177
|
+
}[ResourceType];
|
178
|
+
/**
|
179
|
+
* The base type of custom resource properties. All custom resource defintions
|
180
|
+
* must specify a `ServiceToken`, which is the ARN of the Lambda function or SNS
|
181
|
+
* topic which handles this custom resource.
|
182
|
+
*/
|
183
|
+
export interface CustomResourcePropertiesBase {
|
184
|
+
ServiceToken: string;
|
185
|
+
}
|
186
|
+
/**
|
187
|
+
* Represents the type of a custom resource.
|
188
|
+
*/
|
189
|
+
export type CustomResourceType<T extends string = string> = `Custom::${T}`;
|
190
|
+
/**
|
191
|
+
* Represents a custom resource definition.
|
192
|
+
*/
|
193
|
+
export type CustomResourceDefinition<P extends CustomResourcePropertiesBase = CustomResourcePropertiesBase, T extends string = string> = ResourceDefinitionBase<P, CustomResourceType<T>>;
|
194
|
+
/**
|
195
|
+
* Represents an AWS or custom resource definition.
|
196
|
+
*/
|
197
|
+
export type ResourceDefinition = AwsResourceDefinition | CustomResourceDefinition;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { IntrinsicValue } from './Fn.js';
|
2
|
+
/**
|
3
|
+
* Definition for a rule assertion.
|
4
|
+
*
|
5
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html#template-constraint-rules-syntax | Rules syntax}
|
6
|
+
*/
|
7
|
+
export interface RuleAssertion {
|
8
|
+
/**
|
9
|
+
* Rule-specific intrinsic function.
|
10
|
+
*
|
11
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html#rules-specific-intrinsic-section-structure | Rule-specific intrinsic functions
|
12
|
+
}
|
13
|
+
*/
|
14
|
+
Assert: IntrinsicValue;
|
15
|
+
/**
|
16
|
+
* Information about this assert.
|
17
|
+
*/
|
18
|
+
AssertDescription?: string;
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Each template rule consists of two properties:
|
22
|
+
*
|
23
|
+
* - Rule condition (optional) — determines when a rule takes effect.
|
24
|
+
* - Assertions (required) — describes what values users can specify for a
|
25
|
+
* particular parameter.
|
26
|
+
*
|
27
|
+
* A rule can include a `RuleCondition` property and must include an Assertions
|
28
|
+
* property. For each rule, you can define only one rule condition. You can
|
29
|
+
* define one or more asserts within the `Assertions` property. If you don't
|
30
|
+
* define a rule condition, the rule's assertions always take effect.
|
31
|
+
*
|
32
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html#w2ab1c23c15c19b5 | Working with rules}
|
33
|
+
*/
|
34
|
+
export interface RuleDefinition {
|
35
|
+
/**
|
36
|
+
* Describes what values users can specify for a particular parameter.
|
37
|
+
*/
|
38
|
+
Assertions: RuleAssertion[];
|
39
|
+
/**
|
40
|
+
* Determines when a rule takes effect.
|
41
|
+
*/
|
42
|
+
RuleCondition?: IntrinsicValue;
|
43
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import { IntrinsicValue } from './Fn.js';
|
2
|
+
import { OutputDefinition } from './OutputDefinition.js';
|
3
|
+
import { ParameterDefinition } from './ParameterDefinition.js';
|
4
|
+
import { ResourceDefinition } from './ResourceDefinition.js';
|
5
|
+
import { RuleDefinition } from './RuleDefinition.js';
|
6
|
+
import { TemplateMap } from './TemplateMap.js';
|
7
|
+
/**
|
8
|
+
* The interface for a CloudFormation template.
|
9
|
+
*
|
10
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html | Template anatomy}
|
11
|
+
*/
|
12
|
+
export interface Template {
|
13
|
+
/**
|
14
|
+
* The AWSTemplateFormatVersion section (optional) identifies the capabilities
|
15
|
+
* of the template. The latest template format version is 2010-09-09 and is
|
16
|
+
* currently the only valid value.
|
17
|
+
*
|
18
|
+
* The value for the template format version declaration must be a literal
|
19
|
+
* string. You can't use a parameter or function to specify the template
|
20
|
+
* format version. If you don't specify a value, AWS CloudFormation assumes
|
21
|
+
* the latest template format version.
|
22
|
+
*
|
23
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html | Format version}
|
24
|
+
*/
|
25
|
+
AWSTemplateFormatVersion?: '2010-09-09';
|
26
|
+
/**
|
27
|
+
* The optional Conditions section contains statements that define the
|
28
|
+
* circumstances under which entities are created or configured. For example,
|
29
|
+
* you can create a condition and then associate it with a resource or output
|
30
|
+
* so that AWS CloudFormation only creates the resource or output if the
|
31
|
+
* condition is true. Similarly, you can associate the condition with a
|
32
|
+
* property so that AWS CloudFormation only sets the property to a specific
|
33
|
+
* value if the condition is true. If the condition is false, AWS
|
34
|
+
* CloudFormation sets the property to a different value that you specify.
|
35
|
+
*
|
36
|
+
* You might use conditions when you want to reuse a template that can create
|
37
|
+
* resources in different contexts, such as a test environment versus a
|
38
|
+
* production environment. In your template, you can add an EnvironmentType
|
39
|
+
* input parameter, which accepts either prod or test as inputs. For the
|
40
|
+
* production environment, you might include Amazon EC2 instances with certain
|
41
|
+
* capabilities; however, for the test environment, you want to use reduced
|
42
|
+
* capabilities to save money. With conditions, you can define which resources
|
43
|
+
* are created and how they're configured for each environment type.
|
44
|
+
*
|
45
|
+
* Conditions are evaluated based on predefined pseudo parameters or input
|
46
|
+
* parameter values that you specify when you create or update a stack. Within
|
47
|
+
* each condition, you can reference another condition, a parameter value, or
|
48
|
+
* a mapping. After you define all your conditions, you can associate them
|
49
|
+
* with resources and resource properties in the Resources and Outputs
|
50
|
+
* sections of a template.
|
51
|
+
*
|
52
|
+
* At stack creation or stack update, AWS CloudFormation evaluates all the
|
53
|
+
* conditions in your template before creating any resources. Resources that
|
54
|
+
* are associated with a true condition are created. Resources that are
|
55
|
+
* associated with a false condition are ignored. AWS CloudFormation also
|
56
|
+
* re-evaluates these conditions at each stack update before updating any
|
57
|
+
* resources. Resources that are still associated with a true condition are
|
58
|
+
* updated. Resources that are now associated with a false condition are
|
59
|
+
* deleted.
|
60
|
+
*
|
61
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html | Conditions}
|
62
|
+
*/
|
63
|
+
Conditions?: TemplateMap<IntrinsicValue>;
|
64
|
+
/**
|
65
|
+
* The optional `Mappings` section matches a key to a corresponding set of
|
66
|
+
* named values. For example, if you want to set values based on a region, you
|
67
|
+
* can create a mapping that uses the region name as a key and contains the
|
68
|
+
* values you want to specify for each specific region. You use the
|
69
|
+
* `Fn::FindInMap` intrinsic function to retrieve values in a map.
|
70
|
+
*
|
71
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html | Mappings}
|
72
|
+
*/
|
73
|
+
Mappings?: TemplateMap<TemplateMap<TemplateMap<IntrinsicValue>>>;
|
74
|
+
/**
|
75
|
+
* You can use the optional `Metadata` section to include arbitrary JSON or
|
76
|
+
* YAML objects that provide details about the template.
|
77
|
+
*
|
78
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html | Metadata}
|
79
|
+
*/
|
80
|
+
Metadata?: TemplateMap<IntrinsicValue>;
|
81
|
+
/**
|
82
|
+
* The optional `Outputs` section declares output values that you can import
|
83
|
+
* into other stacks (to create cross-stack references), return in response
|
84
|
+
* (to describe stack calls), or view on the AWS CloudFormation console. For
|
85
|
+
* example, you can output the S3 bucket name for a stack to make the bucket
|
86
|
+
* easier to find.
|
87
|
+
*
|
88
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html | Outputs}
|
89
|
+
*/
|
90
|
+
Outputs?: TemplateMap<OutputDefinition>;
|
91
|
+
/**
|
92
|
+
* Use the optional `Parameters` section to customize your templates.
|
93
|
+
* Parameters enable you to input custom values to your template each time you
|
94
|
+
* create or update a stack.
|
95
|
+
*
|
96
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html | Parameters}
|
97
|
+
*/
|
98
|
+
Parameters?: TemplateMap<ParameterDefinition>;
|
99
|
+
/**
|
100
|
+
* The required `Resources` section declares the AWS resources that you want
|
101
|
+
* to include in the stack, such as an Amazon EC2 instance or an Amazon S3
|
102
|
+
* bucket.
|
103
|
+
*
|
104
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html | Resources}
|
105
|
+
*/
|
106
|
+
Resources: TemplateMap<ResourceDefinition>;
|
107
|
+
/**
|
108
|
+
* The optional `Rules` section validates a parameter or a combination of
|
109
|
+
* parameters passed to a template during a stack creation or stack update. To
|
110
|
+
* use template rules, explicitly declare `Rules` in your template followed by
|
111
|
+
* an assertion. Use the rules section to validate parameter values before
|
112
|
+
* creating or updating resources.
|
113
|
+
*
|
114
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/rules-section-structure.html | Rules}
|
115
|
+
*/
|
116
|
+
Rules?: TemplateMap<RuleDefinition>;
|
117
|
+
}
|
package/lib/Template.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import { AutoScalingReplacingUpdatePolicy } from './AutoScalingReplacingUpdatePolicy.js';
|
2
|
+
import { AutoScalingRollingUpdatePolicy } from './AutoScalingRollingUpdatePolicy.js';
|
3
|
+
import { AutoScalingScheduledActionPolicy } from './AutoScalingScheduledActionPolicy.js';
|
4
|
+
import { CodeDeployLambdaAliasUpdatePolicy } from './CodeDeployLambdaAliasUpdatePolicy.js';
|
5
|
+
/**
|
6
|
+
* Use the `UpdatePolicy` attribute to specify how AWS CloudFormation handles
|
7
|
+
* updates to the `AWS::AppStream::Fleet`,
|
8
|
+
* `AWS::AutoScaling::AutoScalingGroup`, ``AWS::ElastiCache::ReplicationGroup``,
|
9
|
+
* `AWS::OpenSearchService::Domain`, `AWS::Elasticsearch::Domain`, or
|
10
|
+
* `AWS::Lambda::Alias resources`.
|
11
|
+
*
|
12
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html | UpdatePolicy attribute}
|
13
|
+
*/
|
14
|
+
export interface UpdatePolicy {
|
15
|
+
/**
|
16
|
+
* To specify how AWS CloudFormation handles replacement updates for an Auto
|
17
|
+
* Scaling group, use the AutoScalingReplacingUpdate policy. This policy
|
18
|
+
* enables you to specify whether AWS CloudFormation replaces an Auto Scaling
|
19
|
+
* group with a new one or replaces only the instances in the Auto Scaling
|
20
|
+
* group.
|
21
|
+
*
|
22
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-replacingupdate | AutoScalingReplacing update policy}
|
23
|
+
*/
|
24
|
+
AutoScalingReplacing?: AutoScalingReplacingUpdatePolicy;
|
25
|
+
/**
|
26
|
+
* To specify how CloudFormation handles rolling updates for an Auto Scaling
|
27
|
+
* group, use the `AutoScalingRollingUpdate` policy. Rolling updates enable
|
28
|
+
* you to specify whether AWS CloudFormation updates instances that are in an
|
29
|
+
* Auto Scaling group in batches or all at once.
|
30
|
+
*
|
31
|
+
* Be aware that, during stack update rollback operations, CloudFormation uses
|
32
|
+
* the `UpdatePolicy` configuration specified in the template before the
|
33
|
+
* current stack update operation. For example, suppose you have updated the
|
34
|
+
* `MaxBatchSize` in your stack template's `UpdatePolicy` from 1 to 10. You
|
35
|
+
* then perform a stack update, and that update fails and CloudFormation
|
36
|
+
* initiates an update rollback operation. In such a case, CloudFormation will
|
37
|
+
* use 1 as the maximum batch size, rather than 10. For this reason, we
|
38
|
+
* recommend you make changes to the UpdatePolicy configuration in a stack
|
39
|
+
* update separate from and before any updates to the
|
40
|
+
* `AWS::AutoScaling::AutoScalingGroup` resource that are likely to initiate
|
41
|
+
* rolling updates.
|
42
|
+
*
|
43
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-rollingupdate | AutoScalingRollingUpdate policy}
|
44
|
+
*/
|
45
|
+
AutoScalingRollingUpdate?: AutoScalingRollingUpdatePolicy;
|
46
|
+
/**
|
47
|
+
* To specify how AWS CloudFormation handles updates for the `MinSize`,
|
48
|
+
* `MaxSize`, and `DesiredCapacity` properties when the
|
49
|
+
* `AWS::AutoScaling::AutoScalingGroup` resource has an associated scheduled
|
50
|
+
* action, use the `AutoScalingScheduledAction` policy.
|
51
|
+
*
|
52
|
+
* With scheduled actions, the group size properties of an Auto Scaling group
|
53
|
+
* can change at any time. When you update a stack with an Auto Scaling group
|
54
|
+
* and scheduled action, CloudFormation always sets the group size property
|
55
|
+
* values of your Auto Scaling group to the values that are defined in the
|
56
|
+
* `AWS::AutoScaling::AutoScalingGroup` resource of your template, even if a
|
57
|
+
* scheduled action is in effect.
|
58
|
+
*
|
59
|
+
* If you don't want CloudFormation to change any of the group size property
|
60
|
+
* values when you have a scheduled action in effect, use the
|
61
|
+
* `AutoScalingScheduledAction` update policy and set
|
62
|
+
* `IgnoreUnmodifiedGroupSizeProperties` to true to prevent CloudFormation
|
63
|
+
* from changing the `MinSize`, `MaxSize`, or `DesiredCapacity` properties
|
64
|
+
* unless you have modified these values in your template.
|
65
|
+
*
|
66
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-scheduledactions | AutoScalingScheduledAction policy}
|
67
|
+
*/
|
68
|
+
AutoScalingScheduledAction?: AutoScalingScheduledActionPolicy;
|
69
|
+
/**
|
70
|
+
* To perform an CodeDeploy deployment when the version changes on an
|
71
|
+
* `AWS::Lambda::Alias` resource, use the `CodeDeployLambdaAliasUpdate` update
|
72
|
+
* policy.
|
73
|
+
*
|
74
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-codedeploylambdaaliasupdate | CodeDeployLambdaAlias update policy}
|
75
|
+
*/
|
76
|
+
CodeDeployLambdaAliasUpdate?: CodeDeployLambdaAliasUpdatePolicy;
|
77
|
+
/**
|
78
|
+
* To upgrade an OpenSearch Service domain to a new version of OpenSearch or
|
79
|
+
* Elasticsearch rather than replacing the entire
|
80
|
+
* `AWS::OpenSearchService::Domain` or `AWS::Elasticsearch::Domain` resource, use
|
81
|
+
* the `EnableVersionUpgrade` update policy.
|
82
|
+
*
|
83
|
+
* If `EnableVersionUpgrade` is set to true, you can update the `EngineVersion`
|
84
|
+
* property of the `AWS::OpenSearchService::Domain` resource (or the
|
85
|
+
* `ElasticsearchVersion` property of the legacy `AWS::Elasticsearch::Domain`
|
86
|
+
* resource), and CloudFormation will update that property without
|
87
|
+
* interruption. When `EnableVersionUpgrade` is set to false, or not specified,
|
88
|
+
* updating the `EngineVersion` or `ElasticsearchVersion` property results in
|
89
|
+
* CloudFormation replacing the entire
|
90
|
+
* `AWS::OpenSearchService::Domain`/`AWS::Elasticsearch::Domain` resource.
|
91
|
+
*
|
92
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-upgradeopensearchdomain | EnableVersionUpgrade policy}
|
93
|
+
*/
|
94
|
+
EnableVersionUpgrade?: boolean;
|
95
|
+
/**
|
96
|
+
* To modify a replication group's shards by adding or removing shards, rather
|
97
|
+
* than replacing the entire `AWS::ElastiCache::ReplicationGroup` resource,
|
98
|
+
* use the `UseOnlineResharding` update policy.
|
99
|
+
*
|
100
|
+
* If `UseOnlineResharding` is set to true, you can update the `NumNodeGroups`
|
101
|
+
* and `NodeGroupConfiguration` properties of the
|
102
|
+
* `AWS::ElastiCache::ReplicationGroup` resource, and CloudFormation will
|
103
|
+
* update those properties without interruption. When `UseOnlineResharding` is
|
104
|
+
* set to false, or not specified, updating the `NumNodeGroups` and
|
105
|
+
* `NodeGroupConfiguration` properties results in CloudFormation replacing the
|
106
|
+
* entire `AWS::ElastiCache::ReplicationGroup` resource.
|
107
|
+
*
|
108
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-useonlineresharding | UseOnlineResharding policy}
|
109
|
+
*/
|
110
|
+
UseOnlineResharding?: boolean;
|
111
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* To specify how CloudFormation handles rolling updates for an Auto Scaling
|
4
|
+
* group, use the `AutoScalingRollingUpdate` policy. Rolling updates enable you
|
5
|
+
* to specify whether AWS CloudFormation updates instances that are in an Auto
|
6
|
+
* Scaling group in batches or all at once.
|
7
|
+
*
|
8
|
+
* Be aware that, during stack update rollback operations, CloudFormation uses
|
9
|
+
* the `UpdatePolicy` configuration specified in the template before the current
|
10
|
+
* stack update operation. For example, suppose you have updated the
|
11
|
+
* `MaxBatchSize` in your stack template's `UpdatePolicy` from 1 to 10. You then
|
12
|
+
* perform a stack update, and that update fails and CloudFormation initiates an
|
13
|
+
* update rollback operation. In such a case, CloudFormation will use 1 as the
|
14
|
+
* maximum batch size, rather than 10. For this reason, we recommend you make
|
15
|
+
* changes to the UpdatePolicy configuration in a stack update separate from and
|
16
|
+
* before any updates to the `AWS::AutoScaling::AutoScalingGroup` resource that
|
17
|
+
* are likely to initiate rolling updates.
|
18
|
+
*
|
19
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-rollingupdate | AutoScalingRollingUpdate policy}
|
20
|
+
*/
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* To specify how AWS CloudFormation handles updates for the `MinSize`,
|
4
|
+
* `MaxSize`, and `DesiredCapacity` properties when the
|
5
|
+
* `AWS::AutoScaling::AutoScalingGroup` resource has an associated scheduled
|
6
|
+
* action, use the `AutoScalingScheduledAction` policy.
|
7
|
+
*
|
8
|
+
* With scheduled actions, the group size properties of an Auto Scaling group
|
9
|
+
* can change at any time. When you update a stack with an Auto Scaling group
|
10
|
+
* and scheduled action, CloudFormation always sets the group size property
|
11
|
+
* values of your Auto Scaling group to the values that are defined in the
|
12
|
+
* `AWS::AutoScaling::AutoScalingGroup` resource of your template, even if a
|
13
|
+
* scheduled action is in effect.
|
14
|
+
*
|
15
|
+
* If you don't want CloudFormation to change any of the group size property
|
16
|
+
* values when you have a scheduled action in effect, use the
|
17
|
+
* `AutoScalingScheduledAction` update policy and set
|
18
|
+
* `IgnoreUnmodifiedGroupSizeProperties` to true to prevent CloudFormation from
|
19
|
+
* changing the `MinSize`, `MaxSize`, or `DesiredCapacity` properties unless you
|
20
|
+
* have modified these values in your template.
|
21
|
+
*
|
22
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-scheduledactions | AutoScalingScheduledAction policy}
|
23
|
+
*/
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AwsParam = void 0;
|
4
|
+
const Fn_js_1 = require("./Fn.js");
|
5
|
+
/**
|
6
|
+
* Pseudo parameters are parameters that are predefined by AWS CloudFormation.
|
7
|
+
* You don't declare them in your template. Use them the same way as you would a
|
8
|
+
* parameter, as the argument for the Ref function.
|
9
|
+
*
|
10
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html | Psuedo Parameter Reference}
|
11
|
+
*/
|
12
|
+
class AwsParam {
|
13
|
+
/**
|
14
|
+
* Returns the AWS account ID of the account in which the stack is being
|
15
|
+
* created, such as `123456789012`.
|
16
|
+
*
|
17
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-accountid | AWS::AccountId}
|
18
|
+
*/
|
19
|
+
static get AccountId() {
|
20
|
+
return Fn_js_1.Fn.Ref('AWS::AccountId');
|
21
|
+
}
|
22
|
+
/**
|
23
|
+
* Returns the list of notification Amazon Resource Names (ARNs) for the
|
24
|
+
* current stack.
|
25
|
+
*
|
26
|
+
* To get a single ARN from the list, use {@link Fn.Split}.
|
27
|
+
*
|
28
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-notificationarns | AWS::NotificationARNs}
|
29
|
+
*/
|
30
|
+
static get NotificationARNs() {
|
31
|
+
return Fn_js_1.Fn.Ref('AWS::NotificationARNs');
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* Removes the corresponding resource property when specified as a return
|
35
|
+
* value in the `Fn::If` intrinsic function.
|
36
|
+
*
|
37
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-novalue | AWS::NoValue}
|
38
|
+
*/
|
39
|
+
static get NoValue() {
|
40
|
+
return Fn_js_1.Fn.Ref('AWS::NoValue');
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* Returns the partition that the resource is in. For standard AWS Regions,
|
44
|
+
* the partition is `aws`. For resources in other partitions, the partition is
|
45
|
+
* `aws-partitionname`. For example, the partition for resources in the China
|
46
|
+
* (Beijing and Ningxia) Region is `aws-cn` and the partition for resources in
|
47
|
+
* the AWS GovCloud (US-West) region is `aws-us-gov`.
|
48
|
+
*
|
49
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-partition | AWS::Partition}
|
50
|
+
*/
|
51
|
+
static get Partition() {
|
52
|
+
return Fn_js_1.Fn.Ref('AWS::Partition');
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* Returns a string representing the Region in which the encompassing resource
|
56
|
+
* is being created, such as `us-west-2`.
|
57
|
+
*
|
58
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-region | AWS::Region}
|
59
|
+
*/
|
60
|
+
static get Region() {
|
61
|
+
return Fn_js_1.Fn.Ref('AWS::Region');
|
62
|
+
}
|
63
|
+
/**
|
64
|
+
* Returns the ID of the stack as specified with the aws cloudformation
|
65
|
+
* create-stack command, such as
|
66
|
+
* `arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123`.
|
67
|
+
*
|
68
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-stackid | AWS::StackId}
|
69
|
+
*/
|
70
|
+
static get StackId() {
|
71
|
+
return Fn_js_1.Fn.Ref('AWS::StackId');
|
72
|
+
}
|
73
|
+
/**
|
74
|
+
* Returns the name of the stack as specified with the aws cloudformation
|
75
|
+
* `create-stack` command, such as `teststack`.
|
76
|
+
*
|
77
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-stackname | AWS::StackName}
|
78
|
+
*/
|
79
|
+
static get StackName() {
|
80
|
+
return Fn_js_1.Fn.Ref('AWS::StackName');
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* Returns the suffix for a domain. The suffix is typically `amazonaws.com`,
|
84
|
+
* but might differ by Region. For example, the suffix for the China (Beijing)
|
85
|
+
* Region is `amazonaws.com.cn`.
|
86
|
+
*
|
87
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-urlsuffix | AWS::URLSuffix}
|
88
|
+
*/
|
89
|
+
static get URLSuffix() {
|
90
|
+
return Fn_js_1.Fn.Ref('AWS::URLSuffix');
|
91
|
+
}
|
92
|
+
}
|
93
|
+
exports.AwsParam = AwsParam;
|