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

Terraform import aws_vpn_connection does not get tunnel1/2_inside_cidr #18170

Closed
repl-nealalberda opened this issue Jun 1, 2018 · 2 comments
Closed

Comments

@repl-nealalberda
Copy link

Long time user, first time contribute, thanks for all you do!. Reworking my VPN connections and forced to import aws_vpn_connection..

terraform import module.vpn_eu-west-1.aws_vpn_connection.xxxxx_wan1_vpn vpn-xxxxxxxx

module.vpn_eu-west-1.aws_vpn_connection.xxxxx_wan1_vpn: Importing from ID "vpn-xxxxxxxx"...
module.vpn_eu-west-1.aws_vpn_connection.xxxxx_wan1_vpn: Import complete!
Imported aws_vpn_connection (ID: vpn-xxxxxxxx)
module.vpn_eu-west-1.aws_vpn_connection.xxxxx_wan1_vpn: Refreshing state... (ID: vpn-xxxxxxxx)

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

Releasing state lock. This may take a few moments...

Upon a plan I get (redacted some info):
-/+ module.vpn_eu-west-1.aws_vpn_connection.xxxxxxx_wan1_vpn (new resource required)
id: "vpn-xxxxxxxx" => (forces new resource)
customer_gateway_id: "cgw-xxxxxxxx" => "${aws_customer_gateway.xxxxx_wan1.id}" (forces new resource)
routes.#: "0" =>
static_routes_only: "false" => "false"
tags.%: "1" => "1"
tags.Name: "xxxxx_wan1_vpn" => "xxxxx_wan1_vpn"
tunnel1_address: "x.x.x.x" =>
tunnel1_bgp_asn: "12345" =>
tunnel1_bgp_holdtime: "30" =>
tunnel1_cgw_inside_address: "169.254.6.6" =>
tunnel1_inside_cidr: "" => "169.254.6.6/30" (forces new resource)
tunnel1_vgw_inside_address: "169.254.6.5" =>
tunnel2_address: "y.y.y.y" =>
tunnel2_bgp_asn: "12345" =>
tunnel2_bgp_holdtime: "30" =>
tunnel2_cgw_inside_address: "169.254.6.10" =>
tunnel2_inside_cidr: "" => "169.254.6.10/30" (forces new resource)
tunnel2_vgw_inside_address: "169.254.6.9" =>
type: "ipsec.1" => "ipsec.1"
vgw_telemetry.#: "2" =>
vpn_gateway_id: "vgw-zzzzzz" => "${aws_vpn_gateway.vpn_gateway_zzzz.id}" (forces new resource)

If I terraform state pull, amend the state file in the appropriate spots with:
"tunnel1_inside_cidr": "169.254.6.6/30",
"tunnel2_inside_cidr": "169.254.6.10/30",
and terraform state push then no new resource is attempted.

Terraform Version

terraform -v

Terraform v0.11.7

  • provider.aws v1.21.0
...

Terraform Configuration Files

resource "aws_vpn_connection" "xxxxxx_wan1_vpn" {
  vpn_gateway_id      = "${aws_vpn_gateway.vpn_gateway_zzzzz.id}"
  customer_gateway_id = "${aws_customer_gateway.xxxxxx_wan1.id}"
  type                = "ipsec.1"
  tunnel1_inside_cidr = "${var.mytun1}"
  tunnel2_inside_cidr = "${var.mytun2}"
  static_routes_only  = false

  tags {
    Name = "xxxxxx_wan1_vpn"
  }
}

Debug Output

Crash Output

Expected Behavior

Actual Behavior

Steps to Reproduce

Additional Context

References

@ghost
Copy link

ghost commented Jun 1, 2018

This issue has been automatically migrated to hashicorp/terraform-provider-aws#4728 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#4728.

@ghost
Copy link

ghost commented Apr 3, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants