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

Can not change target type on existing aws_route #12631

Closed
RomanSaveljev opened this issue Apr 2, 2020 · 3 comments · Fixed by #16930
Closed

Can not change target type on existing aws_route #12631

RomanSaveljev opened this issue Apr 2, 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

@RomanSaveljev
Copy link

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 v0.12.24
+ provider.aws v2.55.0
+ provider.github v2.5.1

Affected Resource(s)

  • aws_route

Terraform Configuration Files

provider "aws" {
  region      = "eu-west-1"
  max_retries = 10
}

provider "github" {
  anonymous = true
  individual = true
}

//data "github_ip_ranges" "github" {}

resource "aws_vpc" "vpc" {
  cidr_block = "10.200.0.0/16"
}

resource "aws_route_table" "route_table" {
  vpc_id = aws_vpc.vpc.id
}

resource "aws_subnet" "public" {
  vpc_id                          = aws_vpc.vpc.id
  cidr_block                      = "10.200.0.0/22"
  map_public_ip_on_launch         = true
}

resource "aws_internet_gateway" "internet" {
  vpc_id = aws_vpc.vpc.id
}

resource "aws_eip" "eip" {}

resource "aws_nat_gateway" "nat" {
  allocation_id = aws_eip.eip.id
  subnet_id     = aws_subnet.public.id
}

resource "aws_route" "git" {
  route_table_id         = aws_route_table.route_table.id
  destination_cidr_block = "8.8.8.8/32"
  //gateway_id             = aws_internet_gateway.internet.id
  nat_gateway_id         = aws_nat_gateway.nat.id
}

Debug Output

https://gist.github.com/RomanSaveljev/0d5f4ca81c0d343cf79418ae6e2c8ac3

Panic Output

Expected Behavior

  • Changing route target from IGW to NAT succeeds

Actual Behavior

  • terraform apply fails

Steps to Reproduce

  • Take embedded HCL and comment nat_gateway_id and uncomment gateway_id
  • terraform apply to bring the infrastructure up
  • Comment gateway_id and uncomment nat_gateway_id
  • terraform apply to change route target

Important Factoids

References

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Apr 2, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 2, 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.