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] Cannot replace Virtual Private Gateway route with Transit Gateway route in aws_route resource #13302

Closed
snovikov opened this issue May 13, 2020 · 3 comments · Fixed by #16930
Assignees
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@snovikov
Copy link

When trying to replace existing route pointing to VGW (Virtual Private Gateway) with TGW (Transit Gateway) error is thrown.

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 Version

$ terraform version
Terraform v0.12.24
+ provider.aws v2.61.0

Affected Resource(s)

  • aws_route

Terraform Configuration Files

resource "aws_route" "this" {
  for_each = {
    for route in local.routes_in_tables : "${route.table_id}.${route.dest_cidr_block}" => route...
  }

  provider = aws.satellite

  destination_cidr_block = each.value[0].dest_cidr_block
  transit_gateway_id     = local.transit_gateway_id
  route_table_id         = each.value[0].table_id

  depends_on = [aws_ec2_transit_gateway_vpc_attachment.this]
}

Debug Output

When run apply:

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_route.this["rtb-aaaabbbb.10.10.10.0/24"] will be updated in-place
  ~ resource "aws_route" "this" {
        destination_cidr_block = "10.10.10.0/24"
        gateway_id             = "vgw-0aaaabbbbccccdddd"
        id                     = "r-rtb-aaaabbbb1111222233"
        origin                 = "CreateRoute"
        route_table_id         = "rtb-aaaabbbb"
        state                  = "active"
      + transit_gateway_id     = "tgw-0aaaabbbbccccdddd"

        timeouts {}
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Panic Output

Expected Behavior

VGW route is replaced with TGW route

Actual Behavior

Error message:

Error: more than 1 target specified. Only 1 of gateway_id, egress_only_gateway_id, nat_gateway_id, instance_id, network_interface_id or vpc_peering_connection_id is allowed.

Steps to Reproduce

  1. terraform import 'aws_route.this["rtb-aaaabbbb.10.10.10.0/24"]' rtb-aaaabbbb_10.10.10.0/24
  2. terraform apply

Important Factoids

References

Similar to

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label May 13, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 13, 2020
@ghost
Copy link

ghost commented Mar 26, 2021

This has been released in version 3.34.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 for triage. Thanks!

@ghost
Copy link

ghost commented Apr 25, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.