Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update external_ipv6_prefix to not be output only #6619

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9096.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
compute: changed `external_ipv6_prefix` field on `google_compute_subnetwork` resource to not be output only
```
22 changes: 17 additions & 5 deletions google-beta/services/compute/resource_compute_subnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ via BGP even if their destinations match existing subnet ranges.`,
you create the resource. This field can be set only at resource
creation time.`,
},
"external_ipv6_prefix": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
Description: `The range of external IPv6 addresses that are owned by this subnetwork.`,
},
"ipv6_access_type": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -292,11 +299,6 @@ If not specified IPV4_ONLY will be used. Possible values: ["IPV4_ONLY", "IPV4_IP
Computed: true,
Description: `Creation timestamp in RFC3339 text format.`,
},
"external_ipv6_prefix": {
Type: schema.TypeString,
Computed: true,
Description: `The range of external IPv6 addresses that are owned by this subnetwork.`,
},
"gateway_address": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -462,6 +464,12 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
} else if v, ok := d.GetOkExists("ipv6_access_type"); !tpgresource.IsEmptyValue(reflect.ValueOf(ipv6AccessTypeProp)) && (ok || !reflect.DeepEqual(v, ipv6AccessTypeProp)) {
obj["ipv6AccessType"] = ipv6AccessTypeProp
}
externalIpv6PrefixProp, err := expandComputeSubnetworkExternalIpv6Prefix(d.Get("external_ipv6_prefix"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("external_ipv6_prefix"); !tpgresource.IsEmptyValue(reflect.ValueOf(externalIpv6PrefixProp)) && (ok || !reflect.DeepEqual(v, externalIpv6PrefixProp)) {
obj["externalIpv6Prefix"] = externalIpv6PrefixProp
}
allowSubnetCidrRoutesOverlapProp, err := expandComputeSubnetworkAllowSubnetCidrRoutesOverlap(d.Get("allow_subnet_cidr_routes_overlap"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -1340,6 +1348,10 @@ func expandComputeSubnetworkIpv6AccessType(v interface{}, d tpgresource.Terrafor
return v, nil
}

func expandComputeSubnetworkExternalIpv6Prefix(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandComputeSubnetworkAllowSubnetCidrRoutesOverlap(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
7 changes: 4 additions & 3 deletions website/docs/r/compute_subnetwork.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ The following arguments are supported:
cannot enable direct path.
Possible values are: `EXTERNAL`, `INTERNAL`.

* `external_ipv6_prefix` -
(Optional)
The range of external IPv6 addresses that are owned by this subnetwork.

* `allow_subnet_cidr_routes_overlap` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
Typically packets destined to IPs within the subnetwork range that do not match
Expand Down Expand Up @@ -422,9 +426,6 @@ In addition to the arguments listed above, the following computed attributes are

* `internal_ipv6_prefix` -
The internal IPv6 address range that is assigned to this subnetwork.

* `external_ipv6_prefix` -
The range of external IPv6 addresses that are owned by this subnetwork.
* `self_link` - The URI of the created resource.


Expand Down