From e00b2448d8013a20085c5e2abebfab2ac7682e1f Mon Sep 17 00:00:00 2001 From: Joel Vasallo Date: Fri, 7 Oct 2016 19:32:19 -0500 Subject: [PATCH] Fixed alb access_log enabled type to match that of aws-sdk-go --- builtin/providers/aws/resource_aws_alb.go | 4 ++-- builtin/providers/aws/resource_aws_alb_test.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_alb.go b/builtin/providers/aws/resource_aws_alb.go index 99ccd4871..d1ea9a4a9 100644 --- a/builtin/providers/aws/resource_aws_alb.go +++ b/builtin/providers/aws/resource_aws_alb.go @@ -281,7 +281,7 @@ func resourceAwsAlbUpdate(d *schema.ResourceData, meta interface{}) error { attributes = append(attributes, &elbv2.LoadBalancerAttribute{ Key: aws.String("access_logs.s3.enabled"), - Value: aws.String(log["enabled"].(bool)), + Value: aws.String(strconv.FormatBool(log["enabled"].(bool))), }, &elbv2.LoadBalancerAttribute{ Key: aws.String("access_logs.s3.bucket"), @@ -297,7 +297,7 @@ func resourceAwsAlbUpdate(d *schema.ResourceData, meta interface{}) error { } else if len(logs) == 0 { attributes = append(attributes, &elbv2.LoadBalancerAttribute{ Key: aws.String("access_logs.s3.enabled"), - Value: aws.String("false"), + Value: aws.String(strconv.FormatBool(false)), }) } } diff --git a/builtin/providers/aws/resource_aws_alb_test.go b/builtin/providers/aws/resource_aws_alb_test.go index 168eda6c1..ad45f86da 100644 --- a/builtin/providers/aws/resource_aws_alb_test.go +++ b/builtin/providers/aws/resource_aws_alb_test.go @@ -232,6 +232,7 @@ func TestAccAWSALB_accesslogs(t *testing.T) { resource.TestCheckResourceAttr("aws_alb.alb_test", "access_logs.#", "1"), resource.TestCheckResourceAttr("aws_alb.alb_test", "access_logs.0.bucket", bucketName), resource.TestCheckResourceAttr("aws_alb.alb_test", "access_logs.0.prefix", "testAccAWSALBConfig_accessLogs"), + resource.TestCheckResourceAttr("aws_alb.alb_test", "access_logs.0.enabled", "true"), resource.TestCheckResourceAttrSet("aws_alb.alb_test", "arn"), ), }, @@ -582,6 +583,7 @@ func testAccAWSALBConfig_accessLogs(albName, bucketName string) string { access_logs { bucket = "${aws_s3_bucket.logs.bucket}" prefix = "${var.bucket_prefix}" + enabled = "${var.enabled}" } tags {