providers/aws: instance_tenancy is computed, set

This commit is contained in:
Mitchell Hashimoto 2016-04-20 10:48:22 -07:00
parent cfa5a3fe58
commit 35f4201b9e
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 10 additions and 1 deletions

View File

@ -31,6 +31,7 @@ func resourceAwsVpc() *schema.Resource {
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
ForceNew: true, ForceNew: true,
Computed: true,
}, },
"enable_dns_hostnames": &schema.Schema{ "enable_dns_hostnames": &schema.Schema{
@ -140,6 +141,7 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error {
vpcid := d.Id() vpcid := d.Id()
d.Set("cidr_block", vpc.CidrBlock) d.Set("cidr_block", vpc.CidrBlock)
d.Set("dhcp_options_id", vpc.DhcpOptionsId) d.Set("dhcp_options_id", vpc.DhcpOptionsId)
d.Set("instance_tenancy", vpc.InstanceTenancy)
// Tags // Tags
d.Set("tags", tagsToMap(vpc.Tags)) d.Set("tags", tagsToMap(vpc.Tags))

View File

@ -289,7 +289,14 @@ func testIDOnlyRefresh(opts terraform.ContextOpts, r *terraform.ResourceState) e
} }
// Verify attribute equivalence. // Verify attribute equivalence.
actual := state.RootModule().Resources[name].Primary.Attributes actualR := state.RootModule().Resources[name]
if actualR == nil {
return fmt.Errorf("Resource gone!")
}
if actualR.Primary == nil {
return fmt.Errorf("Resource has no primary instance")
}
actual := actualR.Primary.Attributes
expected := r.Primary.Attributes expected := r.Primary.Attributes
if !reflect.DeepEqual(actual, expected) { if !reflect.DeepEqual(actual, expected) {
// Determine only the different attributes // Determine only the different attributes