Merge pull request #10298 from hashicorp/b-vpc-dns-fix
provider/aws: Patch issue with enable dns support
This commit is contained in:
commit
7125288e47
|
@ -46,7 +46,7 @@ func resourceAwsVpc() *schema.Resource {
|
||||||
"enable_dns_support": {
|
"enable_dns_support": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Default: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"enable_classiclink": {
|
"enable_classiclink": {
|
||||||
|
@ -251,13 +251,13 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf(
|
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)
|
d.Id(), modifyOpts)
|
||||||
if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil {
|
if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
d.SetPartial("enable_dns_support")
|
d.SetPartial("enable_dns_hostnames")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, hasEnableDnsSupportOption := d.GetOk("enable_dns_support")
|
_, hasEnableDnsSupportOption := d.GetOk("enable_dns_support")
|
||||||
|
@ -272,7 +272,7 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf(
|
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)
|
d.Id(), modifyOpts)
|
||||||
if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil {
|
if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -28,6 +28,8 @@ func TestAccAWSVpc_basic(t *testing.T) {
|
||||||
"aws_vpc.foo", "cidr_block", "10.1.0.0/16"),
|
"aws_vpc.foo", "cidr_block", "10.1.0.0/16"),
|
||||||
resource.TestCheckResourceAttrSet(
|
resource.TestCheckResourceAttrSet(
|
||||||
"aws_vpc.foo", "default_route_table_id"),
|
"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 = `
|
const testAccVpcConfig_DisabledDnsSupport = `
|
||||||
provider "aws" {
|
provider "aws" {
|
||||||
region = "eu-central-1"
|
region = "us-west-2"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_vpc" "bar" {
|
resource "aws_vpc" "bar" {
|
||||||
|
|
Loading…
Reference in New Issue