aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Support for nested stack changeset

Open pproux opened this issue 5 years ago • 8 comments

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 !

pproux avatar Nov 23 '20 15:11 pproux

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

aahung avatar Mar 03 '21 19:03 aahung

Cool :) Sounds good ! Yes it would be perfect to have the eventual error message without having to have a look at cloudformation

pproux avatar Mar 15 '21 09:03 pproux

What is the status on this, is there a workaround for now?

shadywallas avatar Aug 16 '21 16:08 shadywallas

@shadywallas Thanks for asking. We already added it to our queue for internal review.

Will post here if we have any updates.

xazhao avatar Aug 16 '21 17:08 xazhao

@xazhao What has been the progress since then? I want to use sam xxx instead of aws cloudformation ~~~ :)

mirumirumi avatar Jun 29 '22 14:06 mirumirumi

@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

cscetbon avatar Sep 06 '23 14:09 cscetbon

Any updates on this?

jonachehilton avatar Oct 06 '23 01:10 jonachehilton

Bump! Why can't we see nested stack diffs using sam deploy?

Denny-g6labs avatar Jun 19 '25 07:06 Denny-g6labs

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!"

dcabib avatar Oct 07 '25 11:10 dcabib