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

Parent stack outputs not updated #90

Open
borsothy opened this issue Apr 21, 2016 · 3 comments
Open

Parent stack outputs not updated #90

borsothy opened this issue Apr 21, 2016 · 3 comments

Comments

@borsothy
Copy link
Contributor

I'm not sure if this is intentional or just an unexpected scenario. When I first create a child stack with a parent stack, it works out nice, Moonshot pulls all outputs from the parent stack and "maps" them to the child input parameters. Now this is done by saving all parameters to the local parameter yaml file, which is okay until you relaunch/update the parent stack. The output values of the parent will actually change, but since all keys are already present in the yaml file, it wont ask for the outputs again (which I expected to happen), but use the outdated ones from the yaml instead. This is somewhat related to the issue raised in the parent stack docs, but not exactly the same.

I'm not quite sure how to handle this, since if we just grab all the outputs of the parent stack each time a child stack is being created, we cannot override those values "manually" anymore. Maybe a switch would be nice to force overriding?

@askreet
Copy link
Contributor

askreet commented Apr 21, 2016

This design was actually on purpose, though it should be more explicitly so perhaps. I had a hard time coming up with scenarios where you'd ever want to update the parent stack in a way that would require your child stacks to also update. In production, this sounds like a very bad idea. In development, tear everything down and try again.

In our case (the first use for parent stacks), we are defining networking equipment in the parent stack (like VPCs, Subnets, etc.) as well as a persistent data storage layer (Aurora). If we ever push an update that changes the output of the parent stack, we have by definition completely ruined all child stacks, as they are dependent on resources that have been deprovisioned.

However, if you add new resources to the parent stack, then require their outputs in the child stack, it will all work with two updates.

Could you explain your scenario and we can go from there?

@borsothy
Copy link
Contributor Author

borsothy commented Apr 25, 2016

We are just switching to the exact same setup you described ("network" stack as parent, everything else as child stack).

How I discovered this was:

  1. launch a parent stack
  2. launch child stack
  3. tear down parent and child stack
  4. relaunch parent stack
  5. relaunch child stack

...and output values were "stuck" in the yaml file from # 1 parent launch. It's fine if I have to remove those parameters manually, and it's obviously not a thing in prod, just a bit annoying on dev. I guess you just need to pay attention haha.

This issue is not a crucial at all, just thought it's worth mentioning. :bowtie:

@glennpratt
Copy link
Contributor

What I'd like to see is a sanity check where we check the parent values and stop if they've changed. Then have two flags like --keep-parent-parameters and --update-parent-parameters.

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

3 participants