diff --git a/.changelog/9096.txt b/.changelog/9096.txt new file mode 100644 index 0000000000..ce6987b722 --- /dev/null +++ b/.changelog/9096.txt @@ -0,0 +1,3 @@ +```release-note:bug +compute: changed `external_ipv6_prefix` field on `google_compute_subnetwork` resource to not be output only +``` diff --git a/google-beta/services/compute/resource_compute_subnetwork.go b/google-beta/services/compute/resource_compute_subnetwork.go index c5ee36e85a..6d843f90f8 100644 --- a/google-beta/services/compute/resource_compute_subnetwork.go +++ b/google-beta/services/compute/resource_compute_subnetwork.go @@ -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, @@ -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, @@ -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 @@ -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 } diff --git a/website/docs/r/compute_subnetwork.html.markdown b/website/docs/r/compute_subnetwork.html.markdown index 766d044738..dcca9641c6 100644 --- a/website/docs/r/compute_subnetwork.html.markdown +++ b/website/docs/r/compute_subnetwork.html.markdown @@ -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 @@ -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.