-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot rename ALB Target Group if Listener present #1315
Comments
Using a --- a/my-service/terraform.tf
+++ b/my-service/terraform.tf
@@ -26,6 +26,10 @@ resource "aws_alb_target_group" "service" {
port = 80
protocol = "HTTP"
vpc_id = "vpc-c0ffeffe"
+
+ lifecycle {
+ create_before_destroy = true
+ }
}
resource "aws_alb_listener" "service" { |
Hey @shatil as you found, the Thanks! |
These answers do not work with target groups that have defined names. He would have to switch to name_prefix |
I have this issue, the problem is when you can't use name_prefix ( on my case is because prefix is larger than 6 characters), so I have to manually remove the Listener with the associated target group from the Load Balancer to be able to apply my TF templates. |
I to have encountered this issue without a solution due to name collision. |
Based on the solutions above, i'm using this method :
|
I LOL'd 🤣 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform Version
Affected Resource(s)
aws_alb_target_group
aws_alb_listener
Terraform Configuration Files
Expected Behavior
Changes to
aws_alb_target_group
requiring its re-creation should cascade to dependents ofaws_alb_listener
(s)... or not otherwise trigger an API error.Actual Behavior
Having changed the name of my Target Group, like this:
on
terraform apply
, I received this error:Steps to Reproduce
terraform apply
name
field inaws_alb_target_group
terraform apply
The text was updated successfully, but these errors were encountered: