aws: fix VPN connection acceptance test.

This corrects syntactical errors and uses distinct IP addresses for
each configuration.
This commit is contained in:
Christopher Tiwald 2015-05-03 18:40:10 -04:00
parent 47305c9c5d
commit 4727260987
2 changed files with 13 additions and 23 deletions

View File

@ -35,7 +35,7 @@ func TestAccAwsVpnConnection(t *testing.T) {
"aws_vpc.vpc", "aws_vpc.vpc",
"aws_vpn_gateway.vpn_gateway", "aws_vpn_gateway.vpn_gateway",
"aws_customer_gateway.customer_gateway", "aws_customer_gateway.customer_gateway",
"aws_vpn_connection.bar", "aws_vpn_connection.foo",
), ),
), ),
}, },
@ -85,18 +85,16 @@ func testAccAwsVpnConnection(
} }
const testAccAwsVpnConnectionConfig = ` const testAccAwsVpnConnectionConfig = `
resource "aws_vpc" "vpc" {
cidr_block = "10.0.0.0/16"
}
resource "aws_vpn_gateway" "vpn_gateway" { resource "aws_vpn_gateway" "vpn_gateway" {
vpc_id = "${aws_vpc.vpc.id}" tags {
Name = "vpn_gateway"
}
} }
resource "aws_customer_gateway" "customer_gateway" { resource "aws_customer_gateway" "customer_gateway" {
bgp_asn = 60000 bgp_asn = 60000
ip_address = "172.0.0.1" ip_address = "178.0.0.1"
type = ipsec.1 type = "ipsec.1"
} }
resource "aws_vpn_connection" "foo" { resource "aws_vpn_connection" "foo" {
@ -107,29 +105,21 @@ resource "aws_vpn_connection" "foo" {
} }
` `
// Change static_routes_only to be false, forcing a refresh.
const testAccAwsVpnConnectionConfigUpdate = ` const testAccAwsVpnConnectionConfigUpdate = `
resource "aws_vpc" "vpc" {
cidr_block = "10.0.0.0/16"
}
resource "aws_vpn_gateway" "vpn_gateway" { resource "aws_vpn_gateway" "vpn_gateway" {
vpc_id = "${aws_vpc.vpc.id}" tags {
Name = "vpn_gateway"
}
} }
resource "aws_customer_gateway" "customer_gateway" { resource "aws_customer_gateway" "customer_gateway" {
bgp_asn = 60000 bgp_asn = 60000
ip_address = "172.0.0.1" ip_address = "178.0.0.1"
type = ipsec.1 type = "ipsec.1"
} }
resource "aws_vpn_connection" "foo" { resource "aws_vpn_connection" "foo" {
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
}
resource "aws_vpn_connection" "bar" {
vpn_gateway_id = "${aws_vpn_gateway.vpn_gateway.id}" vpn_gateway_id = "${aws_vpn_gateway.vpn_gateway.id}"
customer_gateway_id = "${aws_customer_gateway.customer_gateway.id}" customer_gateway_id = "${aws_customer_gateway.customer_gateway.id}"
type = "ipsec.1" type = "ipsec.1"

View File

@ -1,7 +1,7 @@
--- ---
layout: "aws" layout: "aws"
page_title: "AWS: aws_vpn_connection" page_title: "AWS: aws_vpn_connection"
sidebar_current: "docs-aws-vpn-connection" sidebar_current: "docs-aws-resource-vpn-connection"
description: |- description: |-
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. 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.
--- ---