Skip to content
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

[Bug]: elbv2/lb: Able to create duplicately named LB #32942

Closed
YakDriver opened this issue Aug 9, 2023 · 3 comments · Fixed by #32941
Closed

[Bug]: elbv2/lb: Able to create duplicately named LB #32942

YakDriver opened this issue Aug 9, 2023 · 3 comments · Fixed by #32941
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@YakDriver
Copy link
Member

Terraform Core Version

1.5.5

AWS Provider Version

5.11.0

Affected Resource(s)

  • aws_lb

Expected Behavior

Should not create when another load balancer already exists with the same name.

Actual Behavior

Right now it is possible to create a load balancer with an aws_lb resource, then (probably accidentally) create another load balancer with the same configuration, but rather than this resulting in a new load balancer, the previously created, existing load balancer is returned. The load balancer is now "managed" by two resources in Terraform, and it is not possible to remove one of them without terraform state rm since removing either of the resources results in deleting the one load balancer.

The accidental "creation" of two Terraform aws_lb resources that manage the same aws_lb, where there is no way to then remove one of them without either destroying the lb or using terraform state rm.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_lb" "test" {
  name            = "olnebuv"
  internal        = true
  security_groups = [aws_security_group.test.id]
  subnets         = aws_subnet.test[*].id

  idle_timeout               = 30
  enable_deletion_protection = false

  tags = {
    Name = "olnebuv"
  }
}

resource "aws_lb" "test2" {
  name            = "olnebuv"
  internal        = true
  security_groups = [aws_security_group.test.id]
  subnets         = aws_subnet.test[*].id

  idle_timeout               = 30
  enable_deletion_protection = false

  tags = {
    Name = "olnebuv"
  }
}

Steps to Reproduce

  1. Apply configuration

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@YakDriver YakDriver added the bug Addresses a defect in current functionality. label Aug 9, 2023
@github-actions github-actions bot added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label Aug 9, 2023
@github-actions
Copy link

github-actions bot commented Aug 9, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added this to the v5.12.0 milestone Aug 10, 2023
@github-actions
Copy link

This functionality has been released in v5.12.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant