How do I prevent the resources in my CloudFormation stack from getting deleted or updated?
Last updated: 2022-09-19
I want to prevent the resources in my AWS CloudFormation stack from getting deleted or updated. How do I do this?
Resolution
To prevent deletion or updates to resources in a CloudFormation stack, you can:
- Set the DeletionPolicy attribute to prevent the deletion of an individual resource at the stack level.
- Use AWS Identity and Access Management (IAM) policies to restrict the ability of users to delete or update a stack and its resources.
- Assign a stack policy to prevent updates to stack resources.
- Turn on termination protection to prevent users from deleting the stack from the AWS CloudFormation console or AWS Command Line Interface (AWS CLI).
Related information
Did this article help you?
Do you need billing or technical support?