Files
opentf/website/source/docs/providers/aws/r/vpn_connection.html.markdown
Paul Stack 3f032ff611 provider/aws: Setting static_routes_only on import of vpn_connection (#9802)
fixes #9110

An error was found where, static_routes_only was not set on a vpn
connection import. This commit introduces setting the static_routes_only
to false when no Options are found. This follows the AWS convention as follows:

```
- options (structure)

Indicates whether the VPN connection requires static routes. If you are creating a VPN connection for a device that does not support BGP, you must specify true .
Default: false

```

So we take it that `static_options_only` is false by default

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpnConnection_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/02 10:38:18 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpnConnection_ -timeout 120m
=== RUN   TestAccAWSVpnConnection_importBasic
--- PASS: TestAccAWSVpnConnection_importBasic (178.29s)
=== RUN   TestAccAWSVpnConnection_basic
--- PASS: TestAccAWSVpnConnection_basic (336.81s)
=== RUN   TestAccAWSVpnConnection_withoutStaticRoutes
--- PASS: TestAccAWSVpnConnection_withoutStaticRoutes (195.45s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	710.572s
```
2016-11-07 16:12:41 +00:00

2.5 KiB

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
aws AWS: aws_vpn_connection docs-aws-resource-vpn-connection Provides a VPN connection connected to a VPC. These objects can be connected to customer gateways, and allow you to establish tunnels between your network and the VPC.

aws_vpn_connection

Provides a VPN connection connected to a VPC. These objects can be connected to customer gateways, and allow you to establish tunnels between your network and the VPC.

Example Usage

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
}

Argument Reference

The following arguments are supported:

  • customer_gateway_id - (Required) The ID of the customer gateway.
  • static_routes_only - (Optional, Default false) Whether the VPN connection uses static routes exclusively. Static routes must be used for devices that don't support BGP.
  • tags - (Optional) Tags to apply to the connection.
  • type - (Required) The type of VPN connection. The only type AWS supports at this time is "ipsec.1".
  • vpn_gateway_id - (Required) The ID of the virtual private gateway.

Attribute Reference

The following attributes are exported:

  • id - The amazon-assigned ID of the VPN connection.
  • customer_gateway_configuration - The configuration information for the VPN connection's customer gateway (in the native XML format).
  • customer_gateway_id - The ID of the customer gateway to which the connection is attached.
  • static_routes_only - Whether the VPN connection uses static routes exclusively.
  • tags - Tags applied to the connection.
  • tunnel1_address - The public IP address of the first VPN tunnel.
  • tunnel1_preshared_key - The preshared key of the first VPN tunnel.
  • tunnel2_address - The public IP address of the second VPN tunnel.
  • tunnel2_preshared_key - The preshared key of the second VPN tunnel.
  • type - The type of VPN connection.
  • vpn_gateway_id - The ID of the virtual private gateway to which the connection is attached.

Import

VPN Connections can be imported using the vpn connection id, e.g.

$ terraform import aws_vpn_connection.testvpnconnection vpn-40f41529