terraform-aws-rds-cluster icon indicating copy to clipboard operation
terraform-aws-rds-cluster copied to clipboard

Use name_prefix and create_before_destroy on security groups

Open ac-hibbert opened this issue 5 years ago • 2 comments

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

It can be a pain when the security group name changes as it would not be able to destroy - potentially using this pattern would work - https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/main.tf#L34

Expected Behavior

Able to create new security group and assign it prior to destroy

ac-hibbert avatar Oct 20 '20 16:10 ac-hibbert

I do not understand the problem. Why would the security group name change? How is creating a new security group with a new name solving the problem?

Nuru avatar Dec 04 '20 05:12 Nuru

@Nuru maybe because a new security group might allow cluster to modify its settings to change to the new group before deleting the old one? Otherwise with a replacement operation, I don't think it will allow you to delete the sg first if it's in use. The group name change for a prefix is probably so that two names don't collide due to create_before_destroy.

I might have just hit a similar issue in the cloudposse/terraform-aws-elasticache-redis module, I just left a comment in there.

vsimon avatar Mar 13 '21 09:03 vsimon