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

TF is unable to revert changes made to aws_vpn_connection in AWS Console #21317

Closed
karaluh opened this issue Oct 15, 2021 · 2 comments · Fixed by #17031 or #22776
Closed

TF is unable to revert changes made to aws_vpn_connection in AWS Console #21317

karaluh opened this issue Oct 15, 2021 · 2 comments · Fixed by #17031 or #22776
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@karaluh
Copy link

karaluh commented Oct 15, 2021

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 CLI and Terraform AWS Provider Version

Terraform v1.0.9
on windows_amd64

  • provider registry.terraform.io/hashicorp/aws v3.63.0

Affected Resource(s)

  • aws_vpn_connection

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

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

resource "aws_vpn_gateway" "vpn_gateway" {
  vpc_id = aws_vpc.vpc.id
}

resource "aws_customer_gateway" "customer_gateway" {
  bgp_asn    = 65000
  ip_address = "172.0.0.1"
  type       = "ipsec.1"
}

resource "aws_vpn_connection" "main" {
  vpn_gateway_id      = aws_vpn_gateway.vpn_gateway.id
  customer_gateway_id = aws_customer_gateway.customer_gateway.id
  type                = "ipsec.1"
  static_routes_only  = true
}

Debug Output

https://gist.github.com/karaluh/4858c0ce45a3457422e395fdca893304

Panic Output

Expected Behavior

Terraform should revert changes to the VPN connection made in AWS Console.

Actual Behavior

terraform apply returns HTTP error 400.

Steps to Reproduce

  1. terraform apply the attached config
  2. Go to AWS Console after the apply finishes https://eu-west-1.console.aws.amazon.com/vpc/home?region=eu-west-1#VpnConnections:sort=VpnConnectionId
  3. Select the connection created by TF
  4. Edit tunnel options (Actions->Modify VPN Tunnel Options)
  5. Select any of the VPN Tunnel Outside IP Address
  6. Change any option, for example switch Startup Action to Start and press Save and afterwards Close
  7. Wait until the change is applied and the value in the State column changes from modifying to available
  8. Apply the TF code again

Important Factoids

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/ec2 Issues and PRs that pertain to the ec2 service. labels Oct 15, 2021
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 15, 2021
@ewbankkit ewbankkit added this to the v4.0.0 milestone Jan 21, 2022
@github-actions
Copy link

This functionality has been released in v4.0.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. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
3 participants