aws-sam-cli
aws-sam-cli copied to clipboard
Support for nested stack changeset
Describe your idea/feature/enhancement
Hi, the aws cloudformation CLI now support nested stack change-set : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/change-sets-for-nested-stacks.html#change-sets-for-nested-stacks-cli
Proposal
Would be nice to have it as well with SAM deploy when generating change set !
I played around by enabling the IncludeNestedStacks and we need to handle how to deliver the nested changeset error. It seems the error creating changeset in nested stacks won't surface by default in botocore.exceptions.WaiterError, and customers can only see message like this:
Nested change set arn:aws:cloudformation:us-west-2:916108123774:changeSet/samcli-deploy1614800918-StackY-XBVUQ6I0JZWD/70d48f2d-741e-457a-baa4-efc682499159 was not successfully created: Currently in FAILED.
They need to head to cloudformation and expand the nested change set to see the actual error message, I believe we should do this for them.
Change
*IncludeNestedStacks is only available since boto3 1.16.21
diff --git a/requirements/base.txt b/requirements/base.txt
index 7cc04dcc..c5f88079 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -2,7 +2,7 @@ chevron~=0.12
click~=7.1
Flask~=1.1.2
#Need to add Schemas latest SDK.
-boto3~=1.14
+boto3==1.16.21
jmespath~=0.10.0
PyYAML~=5.3
cookiecutter~=1.7.2
diff --git a/samcli/lib/deploy/deployer.py b/samcli/lib/deploy/deployer.py
index c51f9095..393c280a 100644
--- a/samcli/lib/deploy/deployer.py
+++ b/samcli/lib/deploy/deployer.py
@@ -168,6 +168,7 @@ class Deployer:
"Parameters": parameter_values,
"Description": "Created by SAM CLI at {0} UTC".format(datetime.utcnow().isoformat()),
"Tags": tags,
+ "IncludeNestedStacks": True,
}
# If an S3 uploader is available, use TemplateURL to deploy rather than
Cool :) Sounds good ! Yes it would be perfect to have the eventual error message without having to have a look at cloudformation
What is the status on this, is there a workaround for now?
@shadywallas Thanks for asking. We already added it to our queue for internal review.
Will post here if we have any updates.
@xazhao
What has been the progress since then?
I want to use sam xxx instead of aws cloudformation ~~~ :)
@xazhao @aahung it's surprising that this issue has been pending for almost 3 years now ... @mirumirumi do you have a way to grab the configuration from samconfig or do you just do it manually ? it's annoying ...
Also I'm not sure I understand what is supported and what is not by SAM. It seems you can deploy nested stacks as well using SAM but what is not working
Any updates on this?
Bump! Why can't we see nested stack diffs using sam deploy?
Implementation Complete!
The nested stack changeset feature has been implemented and is ready for review in [PR #8299] (https://github.com/aws/aws-sam-cli/pull/8299)
What's New: Users can now see nested stack changes directly in `sam deploy` output:
``` [Nested Stack: DatabaseStack]
- Add BackupTable AWS::DynamoDB::Table
- Add DataTable AWS::DynamoDB::Table ```
Key Features:
- ✅ Nested stack changes visible before deployment
- ✅ Specific error messages (no more generic "Currently in FAILED")
- ✅ No CloudFormation console needed
- ✅ Fully backward compatible
- ✅ Production tested
Thanks to everyone who provided feedback on this issue over the past 4+ years!"