From d298613ab86f277db816b2aa5710c873208b31a9 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Thu, 9 Nov 2023 02:23:06 +0000 Subject: [PATCH] update `external_ipv6_prefix` to not be output only (#9096) * update externalIpv6Prefex to not be output only * WIP: adding attribute to update tests * remove tests * remove update4 config * Update mmv1/products/compute/Subnetwork.yaml Co-authored-by: Riley Karson * add back internalipv6 test * add endline * fix lint error --------- Co-authored-by: Riley Karson [upstream:6e6e56eb11daa9dea7d9da7f67f9145cb764c872] Signed-off-by: Modular Magician --- go.mod | 2 +- go.sum | 4 ++-- .../resources/services/compute/compute_subnetwork.go | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7e4b05039..721f3fe65 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/hcl/v2 v2.19.1 github.com/hashicorp/terraform-json v0.17.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 - github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20231108185708-d86a71c1a60d + github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20231109021814-63a6363eec52 github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.3 diff --git a/go.sum b/go.sum index 405123994..87be01757 100644 --- a/go.sum +++ b/go.sum @@ -169,8 +169,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwU github.com/hashicorp/terraform-plugin-mux v0.8.0 h1:WCTP66mZ+iIaIrCNJnjPEYnVjawTshnDJu12BcXK1EI= github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 h1:wcOKYwPI9IorAJEBLzgclh3xVolO7ZorYd6U1vnok14= github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0/go.mod h1:qH/34G25Ugdj5FcM95cSoXzUgIbgfhVLXCcEcYaMwq8= -github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20231108185708-d86a71c1a60d h1:421mt6KpVYtJ0DgIlCUUYp3lElfYmV5QDDeL/BnNLng= -github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20231108185708-d86a71c1a60d/go.mod h1:wsVU2yivr7PtCCyZW5g8ViUf9pokT3yQ6sR5H+CvBHE= +github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20231109021814-63a6363eec52 h1:EBWxX37j5ygEGb61m2ay+D0X8vJoqSELu494wGPA9A0= +github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20231109021814-63a6363eec52/go.mod h1:wsVU2yivr7PtCCyZW5g8ViUf9pokT3yQ6sR5H+CvBHE= github.com/hashicorp/terraform-registry-address v0.2.2 h1:lPQBg403El8PPicg/qONZJDC6YlgCVbWDtNmmZKtBno= github.com/hashicorp/terraform-registry-address v0.2.2/go.mod h1:LtwNbCihUoUZ3RYriyS2wF/lGPB6gF9ICLRtuDk7hSo= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= diff --git a/tfplan2cai/converters/google/resources/services/compute/compute_subnetwork.go b/tfplan2cai/converters/google/resources/services/compute/compute_subnetwork.go index 3b10c1771..14caa540c 100644 --- a/tfplan2cai/converters/google/resources/services/compute/compute_subnetwork.go +++ b/tfplan2cai/converters/google/resources/services/compute/compute_subnetwork.go @@ -158,6 +158,12 @@ func GetComputeSubnetworkApiObject(d tpgresource.TerraformResourceData, config * } 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 nil, 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 nil, err @@ -288,6 +294,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 }