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.74k stars 9.1k forks source link

[Bug]: duplicate aws_vpn_gateway_route_propagation resources allowed #31797

Open rosenbergj opened 1 year ago

rosenbergj commented 1 year ago

Terraform Core Version

1.4.6

AWS Provider Version

4.67.0

Affected Resource(s)

Expected Behavior

Attempting to declare two different vpn_gateway_route_propagation resources with the same VGW ID and RTB ID should error

Actual Behavior

Terraform allows you to declare two different vpn_gateway_route_propagation resources with the same VGW ID and RTB ID. If you then delete one of the resources and apply the change, route propagation is disabled on that RTB, even though the other resource is still defined.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_vpn_gateway_route_propagation" "first" {
  route_table_id = "rtb-0aaaaabbbbbccccc"
  vpn_gateway_id = "vgw-0dddddeeeeefffff"
}
resource "aws_vpn_gateway_route_propagation" "second" {
  route_table_id = "rtb-0aaaaabbbbbccccc"
  vpn_gateway_id = "vgw-0dddddeeeeefffff"
}

Steps to Reproduce

Identify a VGW and RTB in your environment, with propagation to that RTB disabled. Plan and apply the above resources, replacing the IDs with the identified VGW and RTB. Note that the duplicate resource is allowed, and propagation has been enabled.

Then delete one of the resources, and plan and apply again. Note that propagation has been disabled.

If you make no changes, and plan a third time, you may see that terraform wants to re-enable propagation, violating idempotency.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue