aws: Fix customer gateway acceptance test.

This test contained a few syntactical errors.
This commit is contained in:
Christopher Tiwald 2015-05-03 18:35:01 -04:00
parent f31466a60e
commit 47305c9c5d
1 changed files with 29 additions and 14 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/awslabs/aws-sdk-go/aws" "github.com/awslabs/aws-sdk-go/aws"
"github.com/awslabs/aws-sdk-go/service/ec2" "github.com/awslabs/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
) )
@ -25,10 +26,18 @@ func TestAccCustomerGateway(t *testing.T) {
), ),
}, },
resource.TestStep{ resource.TestStep{
Config: testAccCustomerGatewayUpdate, Config: testAccCustomerGatewayConfigUpdateTags,
Check: resource.ComposeTestCheckFunc( Check: resource.ComposeTestCheckFunc(
testAccCheckCustomerGateway( testAccCheckCustomerGateway(
"aws_customer_gateway.bar", "aws_customer_gateway.foo",
),
),
},
resource.TestStep{
Config: testAccCustomerGatewayConfigForceReplace,
Check: resource.ComposeTestCheckFunc(
testAccCheckCustomerGateway(
"aws_customer_gateway.foo",
), ),
), ),
}, },
@ -82,29 +91,35 @@ const testAccCustomerGatewayConfig = `
resource "aws_customer_gateway" "foo" { resource "aws_customer_gateway" "foo" {
bgp_asn = 60000 bgp_asn = 60000
ip_address = "172.0.0.1" ip_address = "172.0.0.1"
type = ipsec.1 type = "ipsec.1"
tags { tags {
Name = "foo-gateway" Name = "foo-gateway"
} }
} }
` `
const testAccCustomerGatewayUpdate = ` // Add the Another: "tag" tag.
const testAccCustomerGatewayConfigUpdateTags = `
resource "aws_customer_gateway" "foo" { resource "aws_customer_gateway" "foo" {
bgp_asn = 60000 bgp_asn = 60000
ip_address = "172.0.0.1" ip_address = "172.0.0.1"
type = ipsec.1 type = "ipsec.1"
tags {
Name = "foo-gateway"
}
}
resource "aws_customer_gateway" "bar" {
bgp_asn = 60000
ip_address = "172.0.0.1"
type = ipsec.1
tags { tags {
Name = "foo-gateway" Name = "foo-gateway"
Another = "tag"
}
}
`
// Change the ip_address.
const testAccCustomerGatewayConfigForceReplace = `
resource "aws_customer_gateway" "foo" {
bgp_asn = 60000
ip_address = "172.10.10.1"
type = "ipsec.1"
tags {
Name = "foo-gateway"
Another = "tag"
} }
} }
` `