From d8f47361f4f422aa7106afa27117c5778d706ebe Mon Sep 17 00:00:00 2001 From: Saurabh Maurya Date: Thu, 10 Aug 2023 14:03:43 -0700 Subject: [PATCH] Fix import issue for Dataplex Datascan (#8578) --- mmv1/products/dataplex/Datascan.yaml | 1 + ...aplex_datascan_ignore_profile_result.go.erb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 mmv1/templates/terraform/custom_flatten/dataplex_datascan_ignore_profile_result.go.erb diff --git a/mmv1/products/dataplex/Datascan.yaml b/mmv1/products/dataplex/Datascan.yaml index e788f3f39dbd..623b4e00df2f 100644 --- a/mmv1/products/dataplex/Datascan.yaml +++ b/mmv1/products/dataplex/Datascan.yaml @@ -642,6 +642,7 @@ properties: - !ruby/object:Api::Type::NestedObject name: 'dataProfileResult' output: true + custom_flatten: templates/terraform/custom_flatten/dataplex_datascan_ignore_profile_result.go.erb description: | The result of the data profile scan. properties: diff --git a/mmv1/templates/terraform/custom_flatten/dataplex_datascan_ignore_profile_result.go.erb b/mmv1/templates/terraform/custom_flatten/dataplex_datascan_ignore_profile_result.go.erb new file mode 100644 index 000000000000..facbad6df5ce --- /dev/null +++ b/mmv1/templates/terraform/custom_flatten/dataplex_datascan_ignore_profile_result.go.erb @@ -0,0 +1,18 @@ +<%# The license inside this block applies to this file. + # Copyright 2022 Google Inc. + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. +-%> +func flatten<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { + // We want to ignore read on this field, but cannot because it is nested + return nil +}