From f31466a60e41aa2389edda20b49caffcb7bffbd3 Mon Sep 17 00:00:00 2001 From: Christopher Tiwald Date: Sun, 3 May 2015 18:31:58 -0400 Subject: [PATCH] aws: Fix app cookie stickiness policy acceptance test. This used the wrong AZ and contained a few syntactical errors in configuration. --- ...e_aws_app_cookie_stickiness_policy_test.go | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/builtin/providers/aws/resource_aws_app_cookie_stickiness_policy_test.go b/builtin/providers/aws/resource_aws_app_cookie_stickiness_policy_test.go index 3846fb68e..3e99ab71d 100644 --- a/builtin/providers/aws/resource_aws_app_cookie_stickiness_policy_test.go +++ b/builtin/providers/aws/resource_aws_app_cookie_stickiness_policy_test.go @@ -6,6 +6,7 @@ import ( "github.com/awslabs/aws-sdk-go/aws" "github.com/awslabs/aws-sdk-go/service/elb" + "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) @@ -30,7 +31,7 @@ func TestAccAWSAppCookieStickinessPolicy(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAppCookieStickinessPolicy( "aws_elb.lb", - "aws_app_cookie_stickiness_policy.bar", + "aws_app_cookie_stickiness_policy.foo", ), ), }, @@ -80,7 +81,7 @@ func testAccCheckAppCookieStickinessPolicy(elbResource string, policyResource st const testAccAppCookieStickinessPolicyConfig = ` resource "aws_elb" "lb" { name = "test-lb" - availability_zones = ["us-east-1a"] + availability_zones = ["us-west-2a"] listener { instance_port = 8000 instance_protocol = "http" @@ -90,17 +91,18 @@ resource "aws_elb" "lb" { } resource "aws_app_cookie_stickiness_policy" "foo" { - name = "foo_policy" - load_balancer = "${aws_elb.lb}" + name = "foo-policy" + load_balancer = "${aws_elb.lb.id}" lb_port = 80 cookie_name = "MyAppCookie" } ` +// Change the cookie_name to "MyOtherAppCookie". const testAccAppCookieStickinessPolicyConfigUpdate = ` resource "aws_elb" "lb" { name = "test-lb" - availability_zones = ["us-east-1a"] + availability_zones = ["us-west-2a"] listener { instance_port = 8000 instance_protocol = "http" @@ -110,16 +112,9 @@ resource "aws_elb" "lb" { } resource "aws_app_cookie_stickiness_policy" "foo" { - name = "foo_policy" - load_balancer = "${aws_elb.lb}" + name = "foo-policy" + load_balancer = "${aws_elb.lb.id}" lb_port = 80 - cookie_name = "MyAppCookie" -} - -resource "aws_app_cookie_stickiness_policy" "bar" { - name = "bar_policy" - load_balancer = "${aws_elb.lb}" - lb_port = 80 - cookie_name = "MyAppCookie" + cookie_name = "MyOtherAppCookie" } `