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

VPC security group data source does not handle duplicate names #5386

Closed
smatzek opened this issue May 23, 2024 · 1 comment · Fixed by #5390
Closed

VPC security group data source does not handle duplicate names #5386

smatzek opened this issue May 23, 2024 · 1 comment · Fixed by #5390
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure

Comments

@smatzek
Copy link
Contributor

smatzek commented May 23, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

1.63.0

Affected Resource(s)

  • ibm_is_security_group

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

data "ibm_is_security_group" "smatzek_vpc_vpc_default_sg" {
  name = "vpc-default"
}

Debug Output

Panic Output

Expected Behavior

I expect to have the ability to correctly use a data source to reference VPC security groups when two groups in different VPCs have the same name.

Actual Behavior

VPC security groups are not required to have universally unique names. They are required to have the same name in a given VPC. When two security groups have the same name in different VPCs the ibm_is_security_group data source can and does lookup and get a reference to the "wrong" security group when trying to work with a specific VPC.

The arguments for the data source only allow "name". They do not allow "vpc": https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/is_security_group#argument-reference

Trying to add "vpc" as an input argument gives an error.

Steps to Reproduce

  1. create two VPC security groups with the same name in different VPCs.
  2. Create some HCL with a security group data source
  3. run Terraform plan
    It will return one of the security groups IDs in the plan output but there is no way to choose WHICH of the conflicting named groups to use.

References

@github-actions github-actions bot added the service/VPC Infrastructure Issues related to the VPC Infrastructure label May 23, 2024
@uibm
Copy link
Collaborator

uibm commented May 24, 2024

Added an enhancement for this. Thank you for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants