Merge pull request #10298 from hashicorp/b-vpc-dns-fix

provider/aws: Patch issue with enable dns support
This commit is contained in:
Clint 2016-11-22 13:51:52 -06:00 committed by GitHub
commit 7125288e47
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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" {