From 47305c9c5d6ef4a8ccabd2cb2b2940eb332ec7a9 Mon Sep 17 00:00:00 2001 From: Christopher Tiwald Date: Sun, 3 May 2015 18:35:01 -0400 Subject: [PATCH] aws: Fix customer gateway acceptance test. This test contained a few syntactical errors. --- .../aws/resource_aws_customer_gateway_test.go | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/builtin/providers/aws/resource_aws_customer_gateway_test.go b/builtin/providers/aws/resource_aws_customer_gateway_test.go index 1d64bbd6b..2a51eb112 100644 --- a/builtin/providers/aws/resource_aws_customer_gateway_test.go +++ b/builtin/providers/aws/resource_aws_customer_gateway_test.go @@ -6,6 +6,7 @@ import ( "github.com/awslabs/aws-sdk-go/aws" "github.com/awslabs/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) @@ -25,10 +26,18 @@ func TestAccCustomerGateway(t *testing.T) { ), }, resource.TestStep{ - Config: testAccCustomerGatewayUpdate, + Config: testAccCustomerGatewayConfigUpdateTags, Check: resource.ComposeTestCheckFunc( 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" { bgp_asn = 60000 ip_address = "172.0.0.1" - type = ipsec.1 + type = "ipsec.1" tags { Name = "foo-gateway" } } ` -const testAccCustomerGatewayUpdate = ` +// Add the Another: "tag" tag. +const testAccCustomerGatewayConfigUpdateTags = ` resource "aws_customer_gateway" "foo" { bgp_asn = 60000 ip_address = "172.0.0.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 + type = "ipsec.1" tags { 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" } } `