Updating dependent stacks

As the other answer suggested method looks a bit longer, here is what I did to overcome this problem after reading this guide:

  1. I have updated importing stack (i.e. stack-lambda) to use actual value of exported parameter(I did that using AWS console so that I don't have to make change in my yml code, submit and deploy)
  2. Deploy exporting stack (i.e. stack-layer) and make sure that the issue is gone
  3. Deploy importing stack from code base.

This was done quite quickly w/o changing source code and interrupting service run. Hope this will be useful, feel free to comment your questions.


As described in Fn::ImportValue documentation, being unable to modify a referenced output is indeed expected behavior:

Note

The following restrictions apply to cross-stack references:

[...]

  • You can't modify or remove an output value that is referenced by another stack.

In order to work around this when updating the output, you can use a second, temporary Output value to handle the transition:

  1. Update stack-layer to add a second Output containing the new value (e.g., layer-arn-2);
  2. Update stack-lambda, changing the "Fn::ImportValue": "layer-arn" reference to instead reference layer-arn-2.
  3. Update stack-layer to remove the now-unused layer-arn Output.
    (Or alternately: update stack-layer to set layer-arn to the same value as layer-arn-2; update stack-lambda to reference layer-arn; then finally update stack-layer to remove the layer-arn-2 Output.

It's a bit tedious, but it should work.