Skip to content
Latchkey

AWS SAM "No changes to deploy. Stack ... is up to date" failing CI

sam deploy creates a CloudFormation change set; if nothing changed, the change set is empty. By default sam treats that as an error and exits non-zero, which fails the CI step even though the stack is fine.

What this error means

sam deploy ends with "Error: No changes to deploy. Stack <name> is up to date" and a non-zero exit, breaking the pipeline when redeploying unchanged infrastructure.

sam
Error: No changes to deploy. Stack my-app is up to date

Common causes

The change set is empty

Nothing in the built template differs from the deployed stack, so CloudFormation creates an empty change set.

Default fail-on-empty behaviour

Without --no-fail-on-empty-changeset, sam returns a non-zero exit code for an empty change set, which CI reads as failure.

How to fix it

Allow empty change sets

Tell sam not to fail when there is nothing to deploy so idempotent re-runs pass.

Terminal
sam deploy --no-fail-on-empty-changeset --resolve-s3 \
  --capabilities CAPABILITY_IAM --no-confirm-changeset

Persist the flag in samconfig.toml

Set it once so every CI deploy tolerates no-op runs.

samconfig.toml
[default.deploy.parameters]
fail_on_empty_changeset = false

How to prevent it

  • Pass --no-fail-on-empty-changeset for idempotent CI deploys.
  • Keep the flag in samconfig.toml.
  • Rebuild before deploy so intended changes actually reach the template.

Frequently asked questions

What causes ""No changes to deploy""?
Nothing in the built template differs from the deployed stack, so CloudFormation creates an empty change set.
How do I fix "No changes to deploy"?
Tell sam not to fail when there is nothing to deploy so idempotent re-runs pass.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card