terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

aws_dx_connection: Error: 2 Direct Connect Connections matched (add filter)

Open rjouhann opened this issue 2 years ago • 1 comments

Description

Today, when you create and delete a Direct Connect Connections with the same name:

Screen Shot 2022-09-21 at 15 03 05

The data source aws_dx_connection isn't usable due to the fact the name is the same for the one deleted and the one in the ordering state. See error returned below because there are 2 connections with the same name.

│ Error: 2 Direct Connect Connections matched; use additional constraints to reduce matches to a single Direct Connect Connection
│ 
│   with data.aws_dx_connection.current_shared_service,
│   on aws_connection.tf line 64, in data "aws_dx_connection" "current_shared_service":
│   64: data "aws_dx_connection" "current_shared_service" {
│ 

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

The idea is to add the filter option in the data source so we can filter on the status.

data "aws_dx_connection" "current_shared_service" {
  provider = aws
  name     = var.pf_crc_aws_shared_services_connection_name
  filter {
    status = "ordering"
  }
}

References

none

Would you like to implement a fix?

No

rjouhann avatar Sep 21 '22 20:09 rjouhann

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[bot] avatar Sep 21 '22 20:09 github-actions[bot]

related #33799

AliAllomani avatar Oct 06 '23 14:10 AliAllomani