Skip to content

Commit

Permalink
feat(client-cloudformation): This release adds a new flag ImportExist…
Browse files Browse the repository at this point in the history
…ingResources to CreateChangeSet. Specify this parameter on a CREATE- or UPDATE-type change set to import existing resources with custom names instead of recreating them.
  • Loading branch information
awstools committed Nov 17, 2023
1 parent e7efd42 commit 9dd25ec
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export interface CreateChangeSetCommandOutput extends CreateChangeSetOutput, __M
* ],
* IncludeNestedStacks: true || false,
* OnStackFailure: "DO_NOTHING" || "ROLLBACK" || "DELETE",
* ImportExistingResources: true || false,
* };
* const command = new CreateChangeSetCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetOutput,
* @public
* <p>Returns the inputs for the change set and a list of changes that CloudFormation will make if you execute the
* change set. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html">Updating Stacks Using Change
* Sets</a> in the CloudFormation User Guide.</p>
* Sets</a> in the <i>CloudFormation User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -130,6 +130,7 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetOutput,
* // ParentChangeSetId: "STRING_VALUE",
* // RootChangeSetId: "STRING_VALUE",
* // OnStackFailure: "DO_NOTHING" || "ROLLBACK" || "DELETE",
* // ImportExistingResources: true || false,
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export interface DescribeStackEventsCommandOutput extends DescribeStackEventsOut
/**
* @public
* <p>Returns all stack related events for a specified stack in reverse chronological order. For more information
* about a stack's event history, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html">Stacks</a> in the CloudFormation User Guide.</p>
* about a stack's event history, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html">Stacks</a> in the
* <i>CloudFormation User Guide</i>.</p>
* <note>
* <p>You can list events for stacks that have failed to create or have been deleted by specifying the unique stack
* identifier (stack ID).</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface ListChangeSetsCommandOutput extends ListChangeSetsOutput, __Met
* // IncludeNestedStacks: true || false,
* // ParentChangeSetId: "STRING_VALUE",
* // RootChangeSetId: "STRING_VALUE",
* // ImportExistingResources: true || false,
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
92 changes: 61 additions & 31 deletions clients/client-cloudformation/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,12 @@ export interface ChangeSetSummary {
* <p>The root change set ID.</p>
*/
RootChangeSetId?: string;

/**
* @public
* <p>Indicates if the stack set imports resources that already exist.</p>
*/
ImportExistingResources?: boolean;
}

/**
Expand Down Expand Up @@ -1825,7 +1831,7 @@ export interface CreateChangeSetInput {
* default, CloudFormation grants permissions to all resource types. Identity and Access Management (IAM)
* uses this parameter for condition keys in IAM policies for CloudFormation. For more information,
* see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html">Controlling access
* with Identity and Access Management</a> in the CloudFormation User Guide.</p>
* with Identity and Access Management</a> in the <i>CloudFormation User Guide</i>.</p>
* <note>
* <p>Only one of the <code>Capabilities</code> and <code>ResourceType</code> parameters can be specified.</p>
* </note>
Expand Down Expand Up @@ -1947,6 +1953,18 @@ export interface CreateChangeSetInput {
* be deleted.</p>
*/
OnStackFailure?: OnStackFailure;

/**
* @public
* <p>Indicates if the stack set imports resources that already exist.</p>
* <note>
* <p>This parameter can only import resources that have custom names in templates. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html">name type</a> in the
* <i>CloudFormation User Guide</i>. To import resources that do not accept custom names, such as EC2 instances,
* use the resource import feature instead. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html">Bringing existing resources into CloudFormation
* management</a> in the <i>CloudFormation User Guide</i>.</p>
* </note>
*/
ImportExistingResources?: boolean;
}

/**
Expand Down Expand Up @@ -2047,7 +2065,7 @@ export interface CreateStackInput {
/**
* @public
* <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For
* more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template anatomy</a> in the CloudFormation User Guide.</p>
* more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template anatomy</a> in the <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must specify either the <code>TemplateBody</code> or the <code>TemplateURL</code> parameter,
* but not both.</p>
*/
Expand All @@ -2057,7 +2075,7 @@ export interface CreateStackInput {
* @public
* <p>Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's
* located in an Amazon S3 bucket or a Systems Manager document. For more information, go to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template anatomy</a> in the
* CloudFormation User Guide.</p>
* <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must specify either the <code>TemplateBody</code> or the <code>TemplateURL</code> parameter,
* but not both.</p>
*/
Expand Down Expand Up @@ -2493,19 +2511,21 @@ export interface StackSetOperationPreferences {
* <ul>
* <li>
* <p>
* <code>STRICT_FAILURE_TOLERANCE</code>: Dynamically lowers the concurrency level to ensure
* the number of failed accounts never exceeds the <code>FailureToleranceCount</code> +1.
* StackSets will set the actual concurrency of your deployment as the minimum value between the
* <code>MaxConcurrentCount</code> and the <code>FailureToleranceCount</code> +1. This is the
* default behavior.</p>
* <code>STRICT_FAILURE_TOLERANCE</code>: This option dynamically lowers the concurrency
* level to ensure the number of failed accounts never exceeds the value of
* <code>FailureToleranceCount</code> +1. The initial actual concurrency is set to the lower of
* either the value of the <code>MaxConcurrentCount</code>, or the value of
* <code>MaxConcurrentCount</code> +1. The actual concurrency is then reduced proportionally by
* the number of failures. This is the default behavior.</p>
* <p>If failure tolerance or Maximum concurrent accounts are set to percentages, the behavior
* is similar.</p>
* </li>
* <li>
* <p>
* <code>SOFT_FAILURE_TOLERANCE</code>: Always run at the concurrency level set by the user
* in the <code>MaxConcurrentCount</code> or <code>MaxConcurrentPercentage</code>, regardless of
* the number of failures.</p>
* <code>SOFT_FAILURE_TOLERANCE</code>: This option decouples
* <code>FailureToleranceCount</code> from the actual concurrency. This allows stack set
* operations to run at the concurrency level set by the <code>MaxConcurrentCount</code> value, or
* <code>MaxConcurrentPercentage</code>, regardless of the number of failures.</p>
* </li>
* </ul>
*/
Expand Down Expand Up @@ -3602,6 +3622,16 @@ export interface DescribeChangeSetOutput {
* </ul>
*/
OnStackFailure?: OnStackFailure;

/**
* @public
* <p>Indicates if the stack set imports resources that already exist.</p>
* <note>
* <p>This parameter can only import resources that have <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html">custom names</a> in templates. To import
* resources that do not accept custom names, such as EC2 instances, use the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html">resource import</a> feature instead.</p>
* </note>
*/
ImportExistingResources?: boolean;
}

/**
Expand Down Expand Up @@ -6614,7 +6644,7 @@ export interface EstimateTemplateCostInput {
* @public
* <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes.
* (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the
* CloudFormation User Guide.)</p>
* <i>CloudFormation User Guide</i>.)</p>
* <p>Conditional: You must pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only
* <code>TemplateBody</code> is used.</p>
*/
Expand All @@ -6623,7 +6653,7 @@ export interface EstimateTemplateCostInput {
/**
* @public
* <p>Location of file containing the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the
* CloudFormation User Guide.</p>
* <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only
* <code>TemplateBody</code> is used.</p>
*/
Expand Down Expand Up @@ -6735,7 +6765,7 @@ export interface GetStackPolicyOutput {
/**
* @public
* <p>Structure containing the stack policy body. (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html"> Prevent Updates to Stack Resources</a> in
* the CloudFormation User Guide.)</p>
* the <i>CloudFormation User Guide</i>.)</p>
*/
StackPolicyBody?: string;
}
Expand Down Expand Up @@ -6800,7 +6830,7 @@ export interface GetTemplateOutput {
/**
* @public
* <p>Structure containing the template body. (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the
* CloudFormation User Guide.)</p>
* <i>CloudFormation User Guide</i>.)</p>
* <p>CloudFormation returns the same template that was used when the stack was created.</p>
*/
TemplateBody?: string;
Expand Down Expand Up @@ -6837,7 +6867,7 @@ export interface GetTemplateSummaryInput {
* @public
* <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For
* more information about templates, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template anatomy</a> in the
* CloudFormation User Guide.</p>
* <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must specify only one of the following parameters: <code>StackName</code>,
* <code>StackSetName</code>, <code>TemplateBody</code>, or <code>TemplateURL</code>.</p>
*/
Expand All @@ -6847,8 +6877,8 @@ export interface GetTemplateSummaryInput {
* @public
* <p>Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's
* located in an Amazon S3 bucket or a Systems Manager document. For more information about templates, see
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template anatomy</a>
* in the CloudFormation User Guide.</p>
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template anatomy</a>
* in the <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must specify only one of the following parameters: <code>StackName</code>,
* <code>StackSetName</code>, <code>TemplateBody</code>, or <code>TemplateURL</code>.</p>
*/
Expand Down Expand Up @@ -7420,10 +7450,10 @@ export interface StackInstanceResourceDriftsSummary {

/**
* @public
* <p>Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context
* key-value pairs in cases where a resource's logical and physical IDs aren't enough to uniquely
* identify that resource. Each context key-value pair specifies a unique resource that contains the
* targeted resource.</p>
* <p>Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses
* context key-value pairs in cases where a resource's logical and physical IDs aren't enough
* to uniquely identify that resource. Each context key-value pair specifies a unique resource
* that contains the targeted resource.</p>
*/
PhysicalResourceIdContext?: PhysicalResourceIdContextKeyValuePair[];

Expand All @@ -7436,9 +7466,9 @@ export interface StackInstanceResourceDriftsSummary {

/**
* @public
* <p>Status of the actual configuration of the resource compared to its expected configuration.
* These will be present only for resources whose <code>StackInstanceResourceDriftStatus</code> is
* <code>MODIFIED</code>. </p>
* <p>Status of the actual configuration of the resource compared to its expected
* configuration. These will be present only for resources whose
* <code>StackInstanceResourceDriftStatus</code> is <code>MODIFIED</code>. </p>
*/
PropertyDifferences?: PropertyDifference[];

Expand Down Expand Up @@ -9549,8 +9579,8 @@ export interface SetStackPolicyInput {
/**
* @public
* <p>Structure containing the stack policy body. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html"> Prevent updates to stack resources</a> in
* the CloudFormation User Guide. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code>
* parameter, but not both.</p>
* the <i>CloudFormation User Guide</i>. You can specify either the <code>StackPolicyBody</code> or the
* <code>StackPolicyURL</code> parameter, but not both.</p>
*/
StackPolicyBody?: string;

Expand Down Expand Up @@ -9844,7 +9874,7 @@ export interface UpdateStackInput {
* @public
* <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes.
* (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the
* CloudFormation User Guide.)</p>
* <i>CloudFormation User Guide</i>.)</p>
* <p>Conditional: You must specify only one of the following parameters: <code>TemplateBody</code>,
* <code>TemplateURL</code>, or set the <code>UsePreviousTemplate</code> to <code>true</code>.</p>
*/
Expand All @@ -9853,7 +9883,7 @@ export interface UpdateStackInput {
/**
* @public
* <p>Location of file containing the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the
* CloudFormation User Guide.</p>
* <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must specify only one of the following parameters: <code>TemplateBody</code>,
* <code>TemplateURL</code>, or set the <code>UsePreviousTemplate</code> to <code>true</code>.</p>
*/
Expand Down Expand Up @@ -10596,7 +10626,7 @@ export interface ValidateTemplateInput {
/**
* @public
* <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For
* more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the CloudFormation User Guide.</p>
* more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only
* <code>TemplateBody</code> is used.</p>
*/
Expand All @@ -10606,7 +10636,7 @@ export interface ValidateTemplateInput {
* @public
* <p>Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that
* is located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the
* CloudFormation User Guide.</p>
* <i>CloudFormation User Guide</i>.</p>
* <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only
* <code>TemplateBody</code> is used.</p>
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-cloudformation/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5478,6 +5478,9 @@ const se_CreateChangeSetInput = (input: CreateChangeSetInput, context: __SerdeCo
if (input.OnStackFailure != null) {
entries["OnStackFailure"] = input.OnStackFailure;
}
if (input.ImportExistingResources != null) {
entries["ImportExistingResources"] = input.ImportExistingResources;
}
return entries;
};

Expand Down Expand Up @@ -8167,6 +8170,9 @@ const de_ChangeSetSummary = (output: any, context: __SerdeContext): ChangeSetSum
if (output["RootChangeSetId"] !== undefined) {
contents.RootChangeSetId = __expectString(output["RootChangeSetId"]);
}
if (output["ImportExistingResources"] !== undefined) {
contents.ImportExistingResources = __parseBoolean(output["ImportExistingResources"]);
}
return contents;
};

Expand Down Expand Up @@ -8442,6 +8448,9 @@ const de_DescribeChangeSetOutput = (output: any, context: __SerdeContext): Descr
if (output["OnStackFailure"] !== undefined) {
contents.OnStackFailure = __expectString(output["OnStackFailure"]);
}
if (output["ImportExistingResources"] !== undefined) {
contents.ImportExistingResources = __parseBoolean(output["ImportExistingResources"]);
}
return contents;
};

Expand Down
Loading

0 comments on commit 9dd25ec

Please sign in to comment.