AWS Security ChangesHomeSearch

AWS AWSCloudFormation documentation change

Service: AWSCloudFormation · 2025-11-22 · Documentation low

File: AWSCloudFormation/latest/UserGuide/stack-refactoring.md

Summary

Restructured stack refactoring documentation to add console guidance, consolidate prerequisites, and reorganize CLI commands. Added detailed console procedure steps, merged refactoring limitations, and updated resource movement limitations (2-5 stacks based on method).

Security assessment

Changes focus on documentation structure, UI workflows, and command renumbering. No security vulnerabilities, configurations, or mitigations are mentioned. The update clarifies operational limits (e.g., 2-5 stacks) and process steps but doesn't introduce security controls or address security flaws.

Diff

diff --git a/AWSCloudFormation/latest/UserGuide/stack-refactoring.md b/AWSCloudFormation/latest/UserGuide/stack-refactoring.md
index 5ea9e175a..9ba69926f 100644
--- a//AWSCloudFormation/latest/UserGuide/stack-refactoring.md
+++ b//AWSCloudFormation/latest/UserGuide/stack-refactoring.md
@@ -5 +5 @@
-How stack refactoring worksStack refactoring considerationsAWS CLI commandsRefactor a stack using the AWS CLIResource limitations
+How stack refactoring worksStack refactoring considerationsPrerequisitesRefactor stacks (console)Refactor stacks (AWS CLI)Resource limitations
@@ -9 +9 @@ How stack refactoring worksStack refactoring considerationsAWS CLI commandsRefac
-With stack refactoring, you can reorganize resources in your CloudFormation stacks while preserving existing resource properties and data. You can move resources between stacks, split large stacks into smaller ones, or combine multiple stacks into one stack.
+With stack refactoring, you can reorganize resources in your CloudFormation stacks while preserving existing resource properties and data. You can move resources between stacks, split large stacks into smaller ones, or combine multiple stacks into one.
@@ -17 +17 @@ With stack refactoring, you can reorganize resources in your CloudFormation stac
-  * AWS CLI commands for stack refactoring
+  * Prerequisites
@@ -19 +19,3 @@ With stack refactoring, you can reorganize resources in your CloudFormation stac
-  * Refactor a stack using the AWS CLI
+  * Refactor stacks (console)
+
+  * Refactor stacks (AWS CLI)
@@ -34 +36 @@ Refactoring stacks involves these phases:
-  3. Determine the destination stacks – Decide which stacks you will refactor resources into. You can move resources between at least 2 stacks, and a maximum of 5 stacks. Resources can be moved between nested stacks.
+  3. Determine the destination stacks – Decide which stacks you will refactor resources into. You can move resources between at least 2 stacks (using the console), and a maximum of 5 stacks (using the AWS CLI). Resources can be moved between nested stacks.
@@ -57,3 +59 @@ As you refactor your stacks, keep the following in mind:
-  * Refactor operations don't allow new resource creations, resource deletions, or changes to resource configurations.
-
-  * You can't change or add new parameters, conditions, or mappings during a stack refactor. A possible workaround is to update your stack before performing the refactor.
+  * Stack refactoring is limited to reorganizing existing resources. You cannot create or delete resources, modify resource configurations, or change or add new parameters, conditions, or mappings during refactoring. To make these changes, update your stacks first, and then perform the stack refactor.
@@ -78 +78,63 @@ As you refactor your stacks, keep the following in mind:
-## AWS CLI commands for stack refactoring
+## Prerequisites
+
+To refactor stacks, you must have already created the revised templates.
+
+Use the [get-template](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/get-template.html) command to retrieve the CloudFormation templates for the stacks that you want to refactor.
+    
+    
+    aws cloudformation get-template --stack-name Stack1
+
+When you have the templates, use the integrated development environment (IDE) of your choice to update them to use the desired structure and resource organization.
+
+## Refactor stacks (console)
+
+Use the following procedure to refactor stacks using the console.
+
+###### To refactor stacks
+
+  1. Sign in to the AWS Management Console and open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).
+
+  2. On the navigation bar at the top of the screen, choose the AWS Region where your stacks are located.
+
+  3. In the navigation pane on the left, choose **Stack refactors**.
+
+  4. On the **Stack refactors** page, choose **Start stack refactor**.
+
+  5. For **Description** , provide a description to help you identify your stack refactor. Then, choose **Next**.
+
+  6. For Stack 1, do the following:
+
+    1. Choose either **Update the template for an existing stack** or **Create new stack**.
+
+If you chose **Update the template for an existing stack** , then select an existing stack from the list. Or choose **Enter a stack ARN** to enter the ARN of an existing stack.
+
+If you chose **Create new stack** , for **Stack name** , provide a name for the new stack.
+
+    2. Under **Replace existing template with refactored template** , choose **Amazon S3 URL** or **Upload a template file** to upload the desired template for Stack 1.
+
+    3. Choose **Next**.
+
+  7. For Stack 2, do the following:
+
+    1. Choose either **Update the template for an existing stack** or **Create new stack**.
+
+If you chose **Update the template for an existing stack** , then select an existing stack from the list. Or choose **Enter a stack ARN** to enter the ARN of an existing stack.
+
+If you chose **Create new stack** , for **Stack name** , provide a name for the new stack.
+
+    2. Under **Replace existing template with refactored template** , choose **Amazon S3 URL** or **Upload template file** to upload the desired template for Stack 2.
+
+    3. Choose **Next**.
+
+  8. On the **Specify logical resource ID renames** page, make sure CloudFormation knows how to refactor stacks by mapping any resources shown to their correct logical IDs. As part of the stack refactor, if any resource's logical IDs were changed, you need to specify how it was renamed by providing the source stack name, the original logical ID, the destination stack name and the renamed logical ID. In some instances, the CloudFormation console might automatically detect the resource mapping, and you can simply verify that the pre-filled resource mapping is correct before proceeding.
+
+  9. Choose **Next**.
+
+  10. On the **Review and execute** page, review all of your selections from the previous steps and confirm that everything is set up correctly.
+
+  11. When you are ready to refactor the stacks, choose **Execute stack refactor**.
+
+
+
+
+## Refactor stacks (AWS CLI)
@@ -88,2 +149,0 @@ The AWS CLI commands for stack refactoring include:
-  * [get-template](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/get-template.html) to retrieve the template for an existing stack. 
-
@@ -97,2 +156,0 @@ The AWS CLI commands for stack refactoring include:
-## Refactor a stack using the AWS CLI
-
@@ -101,5 +159 @@ Use the following procedure to refactor a stack using the AWS CLI.
-  1. Use the [get-template](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/get-template.html) command to retrieve the CloudFormation templates for the stacks that you want to refactor.
-    
-        aws cloudformation get-template --stack-name Stack1
-
-When you have the templates, use the integrated development environment (IDE) of your choice to update them to use the desired structure and resource organization.
+###### To refactor stacks
@@ -107 +161 @@ When you have the templates, use the integrated development environment (IDE) of
-  2. Use the [create-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/create-stack-refactor.html) command and provide the stack names and updated templates for the stacks to refactor. Include the `--enable-stack-creation` option to allow CloudFormation to create new stacks if they don't already exist. 
+  1. Use the [create-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/create-stack-refactor.html) command and provide the stack names and updated templates for the stacks to refactor. Include the `--enable-stack-creation` option to allow CloudFormation to create new stacks if they don't already exist. 
@@ -145 +199 @@ The following is an example `resource-mapping.json` file.
-  3. Use the [describe-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/describe-stack-refactor.html) command to make sure the `Status` is `CREATE_COMPLETE`. This verifies that the validation is complete.
+  2. Use the [describe-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/describe-stack-refactor.html) command to make sure the `Status` is `CREATE_COMPLETE`. This verifies that the validation is complete.
@@ -162 +216 @@ Example output:
-  4. Use the [list-stack-refactor-actions](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/list-stack-refactor-actions.html) command to preview the specific actions that will be performed.
+  3. Use the [list-stack-refactor-actions](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/list-stack-refactor-actions.html) command to preview the specific actions that will be performed.
@@ -229 +283 @@ Example output:
-  5. After reviewing and confirming your changes, use the [execute-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/execute-stack-refactor.html) command to complete the stack refactoring operation.
+  4. After reviewing and confirming your changes, use the [execute-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/execute-stack-refactor.html) command to complete the stack refactoring operation.
@@ -234 +288 @@ Example output:
-  6. Use the [describe-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/describe-stack-refactor.html) command to monitor the execution status.
+  5. Use the [describe-stack-refactor](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/describe-stack-refactor.html) command to monitor the execution status.