Joey Yi Zhao
Joey Yi Zhao

Reputation: 42674

How does cloudformation rollback lambda deployment?

I am using cloudformation to deploy a stack including lambdas, roles, cloudwatch rules etc. I see if cf failed to deploy an update, it roll back the deployment. My question is that how cf manage the lambda deployment for the rollback?

If the iam role in the stack failed to deploy but lambda is success, cf will rollback all the changes in the current deployment. How does cf know how to rollback the lambda deployment? Does it use lambda version for that? If I disable lambda version, will it cause any issue in this case?

Upvotes: 1

Views: 857

Answers (1)

Marcin
Marcin

Reputation: 239000

Its the same like for any other resources. CFN "knows" what is the state of all resources setup before an update. If the update fails, rollback brings back everything to the last recorded valid state.

The process is not perfect and the rollback may fail. Then you have an option to manually skip the problematic resources and continue the rollback.

Does it use lambda version for that? If I disable lambda version, will it cause any issue in this case?

No, it does not create or update any versions. Thus there is no difference between rollback with and without versioning. Whatever was the last good know of state of stack with the lambda function, the rollback will try to reverse all changes back to the state.

Upvotes: 2

Related Questions