AWS CloudFormation introduces a new capability called stack refactoring that makes it easy to reorganize cloud resources across your CloudFormation stacks. Stack refactoring enables you to move resources from one stack to another, split monolithic stacks into smaller components, and rename the logical name of resources within a stack. This enables you to adapt your stacks to meet architectural patterns, operational needs, or business requirements.
As your workloads scale and requirements evolve, re-architecting resources into a new stack structure can become necessary. For example, you may need to split a monolithic stack for easier resource lifecycle management or rename resource logical IDs to align with new naming conventions. Previously, refactoring a stack required multiple manual steps, such as updating templates to retain targeted resources, removing them from current stacks, and then importing them into new stacks. Stack refactoring improves the speed and safety of this process. To refactor a stack, you first provide the CloudFormation templates that reflect the desired stack structure. Then, you generate a preview of the refactor operation, allowing you to confirm that the refactoring changes align with your requirements. If the planned changes meet your expectations, you can execute the refactor operation through an atomic workflow. This new capability enables seamless and continuous adaptation to evolving architectural patterns.
Stack refactor is available in all AWS Regions where CloudFormation is supported. To get started, update your CloudFormation templates to reflect the desired stack structure, then use the AWS CLI or SDK to perform the refactor operation. Visit our user guide to learn more about this feature.
Source:: Amazon AWS