hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.16k forks source link

[Bug]: Error: no schema available for data.aws_ec2_transit_gateway_dx_attachment.example to validate for self-references; this is a bug in Terraform and should be reported #32948

Open Maxi3315 opened 1 year ago

Maxi3315 commented 1 year ago

Terraform Core Version

1.3.9

AWS Provider Version

5.11.0

Affected Resource(s)

data.aws_ec2_transit_gateway_dx_attachment

Expected Behavior

Retrieve existing Transit Gateway DX Attachment resource through data aws_ec2_transit_gateway_dx_attachment

Actual Behavior

Error: no schema available for data.aws_ec2_transit_gateway_dx_attachment.example to validate for self-references; this is a bug in Terraform and should be reported

Relevant Error/Panic Output Snippet

Error: no schema available for data.aws_ec2_transit_gateway_dx_attachment.example to validate for self-references; this is a bug in Terraform and should be reported

Terraform Configuration Files

data "aws_ec2_transit_gateway_dx_attachment" "example" {
  provider = aws.example
  transit_gateway_id = aws_ec2_transit_gateway.example.id
  dx_gateway_id      = "DX_ID"
}

OR

data "aws_ec2_transit_gateway_dx_attachment" "example" {
  provider = aws.example
  filter {
    name   = "transit-gateway-id"
    values = [aws_ec2_transit_gateway.example.id]
  }

  filter {
    name   = "resource-id"
    values = ["DX_ID"]
  }
}

Steps to Reproduce

  1. DX creation (via AWS Console)
  2. TGW creation (via AWS Console)
  3. TGW Attachment to DX (via AWS Console)
  4. TGW routes to DX (via AWS Console)
  5. Write Terraform data code for aws_ec2_transit_gateway_dx_attachment with TGW routes code (existing TGW routes)
  6. Try to import TGW routes

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue