Rename a CloudFormation stack
MIT License
The following script will programmatically perform the following steps:
As the stack is recreated entirely, the history of the stack will not be retained. Note that not all stacks will support a stack rename, only those that exclusively contain importable types.
❗ This script is not thoroughly tested and you should attempt to use this on a non-critical resource before real-world usage as some resources refuse to re-import for a variety of reasons. I am not responsible for your data loss.
python3 index.py OldStackName NewStackName
or to specify a region
python3 index.py OldStackName NewStackName us-east-1
or to specify a region and profile name
python3 index.py OldStackName NewStackName us-east-1 myprofile
The following resources are supported for stack rename (if other resources are within the stack, the script will refuse to continue):
Fn::ImportValue
reference against it will cause the stack to be unable to be deleted