question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using output of nested stacks in other nested stacks?

See original GitHub issue

I’m building my own stacks for my API and was going along great building 1 stack per dynamodb table, essentially – 1 stack per data source since all of my basic resolvers operated on only a single data source.

However now I’m trying to include my pipeline resolvers - which include functions that reference various data sources. I thought I would be able to get the function ids out of their stacks as Output properties – but the problem is the nested stacks get created in an unpredictable order so it’s a race condition if the output exists by the time I try to reference it.

I don’t see a way to determine this order or tell a stack that it depends on another stack. My solution for now is to just put all of these things into 1 big stack which isn’t great for maintainability.

I also tried adding a custom stack as explained in the docs and make it depend on my api stack but my problem there is I think the service still needs to be AppSync – which seemed to basically just not work. Any advice or am I stuck for now with 1 big stack?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ambientlightcommented, Nov 7, 2019

@chadkouse: most straightforward way to go is using Fn::ImportValue. For short, your nested stack outputs have extra property: Export that define export name. Those exported values are available globally within a aws region (you can see all exported values in CloudFormation console). They can latter be thrown in any other stack with Fn::ImportValue, hope this helps

0reactions
github-actions[bot]commented, May 27, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass values between nested stacks in the same AWS ...
You have two nested stacks, NestedStackA and NestedStackB, that are part of the same parent stack. You want to use a value from...
Read more >
Getting multiple Outputs out of CloudFormation Nested Stacks
My JSON templates are broken down into sections. The first two examples come from the Nested Stacks that are called via the Parent...
Read more >
Cloudformation nested stack outputs in yaml - Stack Overflow
It worked for me using these 2 stacks: root.yml : AWSTemplateFormatVersion: '2010-09-09' Resources: MyNestedStack: Type: AWS::CloudFormation::Stack ...
Read more >
Nested Stacks or Cross-stack References? Which to Organize ...
In this post, I talk about the differences between organizing your AWS CloudFormation stacks using nested stacks or cross-stack references.
Read more >
Simplifying CloudFormation deployments using Nested Stacks
Here's an example of a simple nested stack. CloudFormation Nested Stacks. Your first step is to create the parent template. Think of this ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found