From fcd38a3e1c5ee1755efa0b5223bbe8a5ee3ae410 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Wed, 17 Apr 2024 15:49:19 +0000 Subject: [PATCH] bigquerydatapolicy: support routine (#10388) [upstream:b3de1c9d61d88c9f176730f547164a607b53e139] Signed-off-by: Modular Magician --- go.mod | 2 +- go.sum | 4 ++-- .../bigquerydatapolicy_data_policy.go | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d4a80ca98..dee4c03cd 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.21.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240416224441-33ea4b6e8244 + github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240417154639-db07898a3ced github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum index 2c95d443f..e3bfbce2e 100644 --- a/go.sum +++ b/go.sum @@ -185,8 +185,8 @@ github.com/hashicorp/terraform-plugin-mux v0.15.0 h1:+/+lDx0WUsIOpkAmdwBIoFU8UP9 github.com/hashicorp/terraform-plugin-mux v0.15.0/go.mod h1:9ezplb1Dyq394zQ+ldB0nvy/qbNAz3mMoHHseMTMaKo= github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= -github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240416224441-33ea4b6e8244 h1:4TeDoag1RD8ZdinlehYep+F+8WwjlvxM2zwLZke4oZA= -github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240416224441-33ea4b6e8244/go.mod h1:OGg+gykjRwc0c1aGJg9W271SaG3x6JZRFSCVcYhYJe0= +github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240417154639-db07898a3ced h1:/CvCLLapsIpi9IWAM8txB/PNx+6f8m3MFGmMpH0RA8g= +github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240417154639-db07898a3ced/go.mod h1:OGg+gykjRwc0c1aGJg9W271SaG3x6JZRFSCVcYhYJe0= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= diff --git a/tfplan2cai/converters/google/resources/services/bigquerydatapolicy/bigquerydatapolicy_data_policy.go b/tfplan2cai/converters/google/resources/services/bigquerydatapolicy/bigquerydatapolicy_data_policy.go index 55b1842c3..1a6f9d7fa 100644 --- a/tfplan2cai/converters/google/resources/services/bigquerydatapolicy/bigquerydatapolicy_data_policy.go +++ b/tfplan2cai/converters/google/resources/services/bigquerydatapolicy/bigquerydatapolicy_data_policy.go @@ -110,9 +110,20 @@ func expandBigqueryDatapolicyDataPolicyDataMaskingPolicy(v interface{}, d tpgres transformed["predefinedExpression"] = transformedPredefinedExpression } + transformedRoutine, err := expandBigqueryDatapolicyDataPolicyDataMaskingPolicyRoutine(original["routine"], d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedRoutine); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["routine"] = transformedRoutine + } + return transformed, nil } func expandBigqueryDatapolicyDataPolicyDataMaskingPolicyPredefinedExpression(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { return v, nil } + +func expandBigqueryDatapolicyDataPolicyDataMaskingPolicyRoutine(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { + return v, nil +}