From 2eb132c55a7f94391c8ed4be84a2355d8bbf763a Mon Sep 17 00:00:00 2001 From: clint shryock Date: Tue, 22 Nov 2016 13:44:44 -0600 Subject: [PATCH] provider/aws: Patch issue with enable dns support --- builtin/providers/aws/resource_aws_vpc.go | 8 ++++---- builtin/providers/aws/resource_aws_vpc_test.go | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/builtin/providers/aws/resource_aws_vpc.go b/builtin/providers/aws/resource_aws_vpc.go index e3c2adb7c..89afe6711 100644 --- a/builtin/providers/aws/resource_aws_vpc.go +++ b/builtin/providers/aws/resource_aws_vpc.go @@ -46,7 +46,7 @@ func resourceAwsVpc() *schema.Resource { "enable_dns_support": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, }, "enable_classiclink": { @@ -251,13 +251,13 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { } log.Printf( - "[INFO] Modifying enable_dns_support vpc attribute for %s: %#v", + "[INFO] Modifying enable_dns_hostnames vpc attribute for %s: %s", d.Id(), modifyOpts) if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil { return err } - d.SetPartial("enable_dns_support") + d.SetPartial("enable_dns_hostnames") } _, hasEnableDnsSupportOption := d.GetOk("enable_dns_support") @@ -272,7 +272,7 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { } log.Printf( - "[INFO] Modifying enable_dns_support vpc attribute for %s: %#v", + "[INFO] Modifying enable_dns_support vpc attribute for %s: %s", d.Id(), modifyOpts) if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil { return err diff --git a/builtin/providers/aws/resource_aws_vpc_test.go b/builtin/providers/aws/resource_aws_vpc_test.go index 9b9826a53..29fda784b 100644 --- a/builtin/providers/aws/resource_aws_vpc_test.go +++ b/builtin/providers/aws/resource_aws_vpc_test.go @@ -28,6 +28,8 @@ func TestAccAWSVpc_basic(t *testing.T) { "aws_vpc.foo", "cidr_block", "10.1.0.0/16"), resource.TestCheckResourceAttrSet( "aws_vpc.foo", "default_route_table_id"), + resource.TestCheckResourceAttr( + "aws_vpc.foo", "enable_dns_support", "true"), ), }, }, @@ -298,7 +300,7 @@ resource "aws_vpc" "bar" { const testAccVpcConfig_DisabledDnsSupport = ` provider "aws" { - region = "eu-central-1" + region = "us-west-2" } resource "aws_vpc" "bar" {