Merge pull request #1598 from terraform-providers/paddy_computed_network_tier

Fix network_tier tests.
This commit is contained in:
Paddy 2018-06-05 19:29:21 -07:00 committed by GitHub
commit b7c864604f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -69,6 +69,7 @@ func resourceComputeAddress() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
},
@ -155,9 +156,9 @@ func resourceComputeAddressRead(d *schema.ResourceData, meta interface{}) error
if addr.AddressType == "" {
d.Set("address_type", addressTypeExternal)
}
d.Set("subnetwork", addr.Subnetwork)
d.Set("subnetwork", ConvertSelfLinkToV1(addr.Subnetwork))
d.Set("address", addr.Address)
d.Set("self_link", addr.SelfLink)
d.Set("self_link", ConvertSelfLinkToV1(addr.SelfLink))
d.Set("name", addr.Name)
d.Set("network_tier", addr.NetworkTier)
d.Set("project", addressId.Project)

View File

@ -79,6 +79,7 @@ func resourceComputeForwardingRule() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
},
@ -248,7 +249,7 @@ func resourceComputeForwardingRuleRead(d *schema.ResourceData, meta interface{})
d.Set("name", frule.Name)
d.Set("target", frule.Target)
d.Set("backend_service", frule.BackendService)
d.Set("backend_service", ConvertSelfLinkToV1(frule.BackendService))
d.Set("description", frule.Description)
d.Set("load_balancing_scheme", frule.LoadBalancingScheme)
d.Set("network", frule.Network)
@ -260,7 +261,7 @@ func resourceComputeForwardingRuleRead(d *schema.ResourceData, meta interface{})
d.Set("subnetwork", frule.Subnetwork)
d.Set("ip_address", frule.IPAddress)
d.Set("ip_protocol", frule.IPProtocol)
d.Set("self_link", frule.SelfLink)
d.Set("self_link", ConvertSelfLinkToV1(frule.SelfLink))
return nil
}

View File

@ -358,6 +358,7 @@ func resourceComputeInstance() *schema.Resource {
"network_tier": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
},

View File

@ -241,6 +241,7 @@ func resourceComputeInstanceTemplate() *schema.Resource {
"network_tier": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
},
// Instance templates will never have an