Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for building nested stacks with SAM resources #1213

Closed
kgeisink opened this issue Jun 6, 2019 · 14 comments
Closed

Support for building nested stacks with SAM resources #1213

kgeisink opened this issue Jun 6, 2019 · 14 comments

Comments

@kgeisink
Copy link

kgeisink commented Jun 6, 2019

Describe your idea/feature/enhancement

I would like for it to be possible to deploy a CloudFormation template which contains SAM resources and a nested stack which template in turn also contains SAM resources, without having to update the TemplateURL property of the nested stack in a separate, custom step.

Currently, when both the parent stack and nested stack contain SAM resources, they have to be built separately. This means that the TemplateURL property that refers to the nested stack's template is going to be wrong, not pointing to the template prepared by sam build. It would be great if this relation is kept during the build step, so packaging will still work as normal.

Proposal

(I don't know enough details about SAM CLI to know how realistic any proposal that I have is.)

  • Add a parameter to the build command that allows you to list your nested templates.
  • Somehow find the TemplateURL of any AWS::CloudFormation::Stack resource in a template and verify whether it contains SAM resources.

Additional Details

@kgeisink kgeisink changed the title Support for building parent and nested stacks with SAM resources together Support for building nested stacks with SAM resources Jun 6, 2019
@awood45 awood45 added area/build sam build command priority/2-important type/feature Feature request labels Aug 6, 2019
@michaelgwgutierrez
Copy link

I too would like to see this feature. Currently as a workaround you can run "sam build" on all the nested SAM projects and then build/package/deploy from the parent SAM. A recursive SAM build could be added to projects using nested SAM applications.

@trek10-k37z
Copy link

+1

@jeswanthamazon
Copy link

+1 for this feature

@netochaves
Copy link

+1 for this

1 similar comment
@BeneyKim
Copy link

+1 for this

@made2591-eb
Copy link

I was encountering this problem even before moving to nested stack. What's wrong with sam build?

@trek10-k37z
Copy link

+1

2 similar comments
@edreanernst
Copy link

+1

@codergeorgej
Copy link

+1

@ronaldour
Copy link

ronaldour commented Jun 23, 2020

I too would like to see this feature. Currently as a workaround you can run "sam build" on all the nested SAM projects and then build/package/deploy from the parent SAM. A recursive SAM build could be added to projects using nested SAM applications.

This is not feasible as the parent template would need to point to the generated yaml template in the .aws-sam directory to use the built packages. See #2061
Does anyone has another workaround for this?

I would love to see the sam build to work recursively as sam package does, please share updates or suggestions.

@aahung
Copy link
Contributor

aahung commented Mar 3, 2021

Building resources in nested stack is enabled by default in #2662, to be released

@aahung aahung added stage/waiting-for-release Fix has been merged to develop and is waiting for a release area/nested-stacks labels Mar 3, 2021
@aahung
Copy link
Contributor

aahung commented Mar 4, 2021

released in v1.20.0

@aahung aahung closed this as completed Mar 4, 2021
@aahung aahung removed the stage/waiting-for-release Fix has been merged to develop and is waiting for a release label Mar 4, 2021
@aahung
Copy link
Contributor

aahung commented Mar 4, 2021

let us know if you encounter any issues with nested stacks!

@milesgranger
Copy link

Looking forward to giving it a go very soon, thanks so much! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests