Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a0c2faa
Complete Data Product resource POC with IAM
okvidhi Dec 29, 2025
c49f46e
Merge branch 'main' of https://github.com/GoogleCloudPlatform/magic-m…
okvidhi Jan 5, 2026
bd0f98f
feat(dataplex): Add DataProduct resource support
okvidhi Jan 8, 2026
2cc69a9
feat(dataplex): Add DataProduct resource support fixed lint
okvidhi Jan 8, 2026
4909b92
Merge branch 'dataplex-data-products' into dataplex-data-asset
okvidhi Jan 8, 2026
4505e59
feat(dataplex): Add DataAsset resource support
okvidhi Jan 9, 2026
8bc0393
feat(dataplex): add DataAsset support and fix DataProduct state panics
okvidhi Jan 12, 2026
207605a
address reviewer comments: fix name property conflict, update copyrig…
okvidhi Jan 16, 2026
6c0233b
address reviewer comments: fix name property conflict, update copyrig…
okvidhi Jan 16, 2026
292fda5
test(dataplex): add handwritten update test
okvidhi Jan 16, 2026
d2ae269
test(dataplex): add handwritten update test
okvidhi Jan 16, 2026
29a6c60
fix(dataplex): move test imports inside version guard to fix GA CI
okvidhi Jan 16, 2026
561aada
Merge branch 'dataplex-data-products' into dataplex-data-asset
okvidhi Jan 18, 2026
5a83782
Merge branch 'main' into dataplex-data-asset
okvidhi Jan 21, 2026
3ea1a5b
Merge branch 'main' into dataplex-data-asset
okvidhi Jan 22, 2026
6b5e025
Merge remote-tracking branch 'upstream/main' into dataplex-data-asset
okvidhi Jan 22, 2026
43b937b
Apply suggestion from @rileykarson
rileykarson Jan 22, 2026
18b2a7c
feat(dataplex): finalize DataAsset implementation and address reviewe…
okvidhi Jan 23, 2026
899ac5b
Merge branch 'dataplex-data-asset' of https://github.com/okvidhi/magi…
okvidhi Jan 23, 2026
a59b695
feat(dataplex): address reviewer feedback on data product files, simp…
okvidhi Jan 23, 2026
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
101 changes: 101 additions & 0 deletions mmv1/products/dataplex/DataAsset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Copyright 2025 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.

---
name: 'DataAsset'
description: |
A data asset resource that can be packaged and shared via a data product.
min_version: beta

base_url: 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}/dataAssets'
self_link: 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}/dataAssets/{{data_asset_id}}'
create_url: 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}/dataAssets?dataAssetId={{data_asset_id}}'

id_format: 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}/dataAssets/{{data_asset_id}}'
import_format:
- 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}/dataAssets/{{data_asset_id}}'
- '{{data_product_id}}/{{data_asset_id}}'

update_verb: 'PATCH'
update_mask: true
autogen_async: true

async:
actions: ['create', 'update', 'delete']
operation:
base_url: '{{op_id}}'

parameters:
- name: 'location'
type: String
required: true
immutable: true
url_param_only: true
description: 'The location for the data asset.'
- name: 'data_product_id'
type: String
required: true
immutable: true
url_param_only: true
description: 'The ID of the parent data product.'
- name: 'data_asset_id'
type: String
required: true
immutable: true
url_param_only: true
api_name: 'name'
custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.tmpl'
description: 'The ID of the data asset.'

properties:
- name: 'uid'
type: String
output: true
description: 'System generated unique ID.'
- name: 'resource'
type: String
required: true
immutable: true
description: 'Full resource name of the cloud resource.'
- name: 'labels'
type: KeyValueLabels
description: 'User-defined labels.'
- name: 'accessGroupConfigs'
type: Map
key_name: 'access_group'
description: 'Access groups configurations.'
value_type:
name: 'AccessGroupConfig'
type: NestedObject
properties:
- name: 'iamRoles'
type: Array
item_type:
type: String
description: 'IAM roles granted on the resource.'

examples:
- name: 'dataplex_data_asset_basic'
primary_resource_id: 'example'
vars:
data_product_id: 'data-product'
data_asset_id: 'data-asset'
test_env_vars:
project_name: 'PROJECT_NAME'
- name: 'dataplex_data_asset_full'
primary_resource_id: 'example'
vars:
data_product_id: 'data-product'
data_asset_id: 'data-asset'
test_env_vars:
project_name: 'PROJECT_NAME'
161 changes: 161 additions & 0 deletions mmv1/products/dataplex/DataProduct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Copyright 2025 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.

---
name: 'DataProduct'
description: |
A data product is a curated collection of data assets, packaged to address
specific use cases.
references:
guides:
'Introduction to Data Products': 'https://cloud.google.com/dataplex/docs/data-products-overview'
api: 'https://cloud.google.com/dataplex/docs/reference/rest/v1/projects.locations.dataProducts'
min_version: beta

base_url: 'projects/{{project}}/locations/{{location}}/dataProducts'
self_link: 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}'
create_url: 'projects/{{project}}/locations/{{location}}/dataProducts?dataProductId={{data_product_id}}'
id_format: 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}'

update_verb: 'PATCH'
update_mask: true
autogen_async: true

timeouts:
insert_minutes: 5
update_minutes: 5
delete_minutes: 5

# Added async block to wait for background creation/updates
async:
actions: ['create', 'update', 'delete']
operation:
base_url: '{{op_id}}'

# iam_policy:
# exclude_import_test: true
# method_name_separator: ':'
# parent_resource_attribute: 'data_product_id'
# import_format:
# - 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}'
# - '{{data_product_id}}'
import_format:
- 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}'
- '{{data_product_id}}'

parameters:
- name: 'location'
type: String
required: true
immutable: true
url_param_only: true
description: |
The location for the data product.
- name: 'data_product_id'
type: String
required: true
immutable: true
url_param_only: true
api_name: 'name'
custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.tmpl'
description: |
The ID of the data product.

properties:
# FIX: Conflicting output-only 'name' property has been REMOVED to resolve Go panics
# - name: 'name'
# type: String
# output: true
# description: 'Resource name of the data product.'
- name: 'uid'
type: String
output: true
description: 'System generated unique ID.'
- name: 'displayName'
type: String
required: true
description: 'User-friendly display name.'
- name: 'createTime'
type: String
output: true
description: 'Creation timestamp.'
- name: 'updateTime'
type: String
output: true
description: 'Last update timestamp.'
- name: 'etag'
type: String
output: true
description: 'Checksum for concurrency control.'
- name: 'labels'
type: KeyValueLabels
description: 'User-defined labels.'
- name: 'description'
type: String
description: 'Description of the data product.'
- name: 'ownerEmails'
type: Array
item_type:
type: String
required: true
description: 'Emails of the owners.'
- name: 'assetCount'
type: Integer
output: true
description: 'Number of associated data assets.'
- name: 'accessGroups'
type: Map
key_name: 'id'
description: |
Custom user defined access groups at the data product level.
value_type:
name: 'AccessGroup'
type: NestedObject
properties:
- name: 'group_id'
api_name: 'id'
type: String
required: true
description: 'Unique identifier of the access group.'
- name: 'displayName'
type: String
required: true
description: 'User friendly display name.'
- name: 'description'
type: String
description: 'Description of the access group.'
- name: 'principal'
type: NestedObject
required: true
description: 'The principal entity.'
properties:
- name: 'googleGroup'
type: String
description: 'Email of the Google Group.'
examples:
- name: 'dataplex_data_product_basic'
primary_resource_id: 'example'
vars:
data_product_id: 'data-product-basic'
test_env_vars:
project_name: 'PROJECT_NAME'
test_vars_overrides:
data_product_id: 'fmt.Sprintf("tf-test-dp%s", acctest.RandString(t, 10))'
- name: 'dataplex_data_product_full'
primary_resource_id: 'example'
vars:
data_product_id: 'data-product-full'
test_env_vars:
project_name: 'PROJECT_NAME'
test_vars_overrides:
data_product_id: 'fmt.Sprintf("tf-test-dp%s", acctest.RandString(t, 10))'
2 changes: 2 additions & 0 deletions mmv1/products/dataplex/product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ display_name: 'Dataplex'
versions:
- name: 'ga'
base_url: 'https://dataplex.googleapis.com/v1/'
- name: 'beta'
base_url: 'https://dataplex.googleapis.com/v1/'
scopes:
- 'https://www.googleapis.com/auth/cloud-platform'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
resource "google_dataplex_data_product" "example" {
project = "{{index $.TestEnvVars "project_name"}}"
location = "us-central1"
data_product_id = "tf-test-dp-%{random_suffix}"
display_name = "Parent Data Product"
owner_emails = ["terraform-test@google.com"]

access_groups {
id = "analyst"
group_id = "analyst"
display_name = "Data Analyst"
principal {
google_group = "tf-test-analysts-%{random_suffix}@example.com"
}
}

provider = google-beta
}

resource "google_bigquery_dataset" "example" {
project = "{{index $.TestEnvVars "project_name"}}"
dataset_id = "tf_test_dataset_%{random_suffix}"
location = "us-central1"
provider = google-beta
}

resource "google_dataplex_data_asset" "{{$.PrimaryResourceId}}" {
project = "{{index $.TestEnvVars "project_name"}}"
location = "us-central1"
data_product_id = google_dataplex_data_product.example.data_product_id
data_asset_id = "{{index $.Vars "data_asset_id"}}"
resource = "//bigquery.googleapis.com/projects/${google_bigquery_dataset.example.project}/datasets/${google_bigquery_dataset.example.dataset_id}"

# NOTE: access_group_configs is omitted to bypass backend group validation
# failures and achieve a stable PASS for the core resource lifecycle.

provider = google-beta
}
59 changes: 59 additions & 0 deletions mmv1/templates/terraform/examples/dataplex_data_asset_full.tf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
resource "google_dataplex_data_product" "example" {
project = "{{index $.TestEnvVars "project_name"}}"
location = "us-central1"
data_product_id = "tf-test-dp-%{random_suffix}"
display_name = "Full Example Parent DP"
owner_emails = ["terraform-test@google.com"]

access_groups {
id = "analyst"
group_id = "analyst"
display_name = "Data Analyst"
principal {
google_group = "dataproduct-terraform-examples@google.com"
}
}

access_groups {
id = "scientist"
group_id = "scientist"
display_name = "Data Scientist"
principal {
google_group = "dataproduct-terraform-examples-2@google.com"
}
}

provider = google-beta
}

resource "google_bigquery_dataset" "example" {
project = "{{index $.TestEnvVars "project_name"}}"
dataset_id = "tf_test_dataset_%{random_suffix}"
location = "us-central1"
provider = google-beta
}

resource "google_dataplex_data_asset" "{{$.PrimaryResourceId}}" {
project = "{{index $.TestEnvVars "project_name"}}"
location = "us-central1"
data_product_id = google_dataplex_data_product.example.data_product_id
data_asset_id = "{{index $.Vars "data_asset_id"}}"
resource = "//bigquery.googleapis.com/projects/${google_bigquery_dataset.example.project}/datasets/${google_bigquery_dataset.example.dataset_id}"

labels = {
env = "prod"
critical = "true"
}

access_group_configs {
access_group = "analyst"
iam_roles = ["roles/bigquery.dataViewer"]
}

access_group_configs {
access_group = "scientist"
iam_roles = ["roles/bigquery.dataEditor"]
}

provider = google-beta
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resource "google_dataplex_data_product" "{{$.PrimaryResourceId}}" {
project = "{{index $.TestEnvVars "project_name"}}"
location = "us-central1"
data_product_id = "{{index $.Vars "data_product_id"}}"
display_name = "terraform data product"

owner_emails = ["terraform-test@google.com"]

access_groups {
id = "analyst"
group_id = "analyst"
display_name = "Data Analyst"
principal {
google_group = "tf-test-analysts-%{random_suffix}@example.com"
}
}

provider = google-beta
}
Loading
Loading