Always trigger stack rerun on update
I have a CFN root stack with nested stacks in it, one of which is essentially a lambda function. I want that nested stack to run on any update triggered on the root stack. It may be possible that there is no parameter/template changes to this nested stack, but I still want to rerun it.
detailed use-case: The nested stack retrieves details about a VPC and produces outputs based on that. While the inputs to this stack may not have changed, the outputs may change based on changes in the VPC. Therefore I need a way to tell AWS to
ALWAYS run this stack in case of updates.
I can think of two ways to achieve this.
First Set the lambda up as an cloudwatch rule which is triggered by this specific stack update - I believe this would have to be a "AWS API Call via CloudTrail" event. Your nested stack would create the cloudwatch rule and potentially run the lambda on the initial creation. But I don't think this will work in your case as you need the output within the stack on the update
Second - one I have used multiple times Create a parameter to the parent stack, pass to nested stack and add as a environment var within your lambda. When I have used this method I usually triggered via a pipeline so I make the parameter the pipeline-execution-id so it changes on every execution.
Restore deleted nested stackasked 4 months ago
Nested Stack failed to rollbackasked 4 months ago
How to share one dynamo db table with multiple stacks?asked 3 days ago
CFM stack is stuck after failure deleting Beanstalk appAccepted Answerasked 3 months ago
CloudFormation structuring & splitting of resources between stacksAccepted Answerasked 2 years ago
Always trigger stack rerun on updateasked 2 months ago
Updating CFN stack over multiple accountsAccepted AnswerMODERATORasked 4 years ago
Stack deletion deletes log group but re-creates it on lambda invocationasked 2 years ago
Cloudformation Stack stuck in Update_Rollback_Failed State because of nested stack Update_Rollback_Failedasked 3 months ago
Lambda Functions raise forbidden error until stack deleted and redeployedasked 2 years ago