terraform-provider-aws
terraform-provider-aws copied to clipboard
Feature Request: Add support for Cloudformation Stack Termination Protection
Affected Resource(s)
- aws_cloudformation_stack
Background
AWS released Termination protection for Cloudformation Stacks in August 2017:
https://aws.amazon.com/about-aws/whats-new/2017/09/aws-cloudformation-provides-stack-termination-protection/ https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html
Feature Request
Addition of a termination_protection attribute in the aws_cloudformation_stack resource definition.
+1!
Although I wonder if termination protection should be a separate resource from the stack itself? This is how it's modelled in the AWS API, and it would allow us to enable it for stacks which aren't managed themselves within Terraform using a data provider + termination protection resource.
See https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateTerminationProtection.html
Any idea if this enhancement is coming? It will be really helpful having termination_protection attribute in Terraform aws_cloudformation_stack.
:+1:
I see the issue is closed but there still isn't an parameter for updating termination protection on stacks in the cloudformation resource. Is this forthcoming?
Agree
Any news on this one?
I noticed this limitation when trying to delete a cloudformation stack with this flag enabled. I noticed terraform applied successfully but failed to delete the stack. I see a ticket already exists for this https://github.com/hashicorp/terraform-provider-aws/issues/33960.
Can the PR for this be reopened https://github.com/hashicorp/terraform-provider-aws/pull/10148 ? cc @bflad @justinretzolk
Looking at it now, looks like EnableTerminationProtection is a property of a CloudFormation stack, so perhaps it makes sense to have it as an attribute on a CloudFormation Stack rather than a separate resource.
However, it is modeled as a separate API call for Update, but part of the Stack Creation:
Update: https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateTerminationProtection.html Stack Creation: https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Stack.html
I just bumped into this when attempting to delete a stack-set. Is there currently no way to control this with Terraform?