Home > Enterprise >  How do I update a CloudFormation Template (via CLI or API) if none of the active resources are affec
How do I update a CloudFormation Template (via CLI or API) if none of the active resources are affec

Time:02-05

If I have an existing CloudFormation stack with some resources that are always active, and some that are not always active (i.e., resources that have a Condition that is evaluating to false), and I attempt to update the template of ONLY those inactive resources without activating them (i.e., their Condition is still evaluating to false) via the CLI or API, I get a No updates are to be performed. error:

aws cloudformation update-stack --stack-name <name> --template-body "..."

An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed.

If I then check the Stack Template, it has the previous template, not the new one.

However, if I do what is essentially the same thing but from the AWS Console (i.e., Update Stack -> Replace current template -> Upload a template file -> No other changes), the template will be updated.

Is there some way to accomplish such a template update via CLI or API?

CodePudding user response:

Instead of aws cloudformation update-stack you can use aws cloudformation deploy --no-fail-on-empty-changeset.

References:

  •  Tags:  
  • Related