-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Dataplex data asset #16106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Dataplex data asset #16106
Changes from all commits
a0c2faa
c49f46e
bd0f98f
2cc69a9
4909b92
4505e59
8bc0393
207605a
6c0233b
292fda5
d2ae269
29a6c60
561aada
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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}}' | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Same reasons as below |
||||||
|
|
||||||
| 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' | ||||||
|
Comment on lines
+56
to
+57
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Same reasons as below |
||||||
| 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' | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,150 @@ | ||||||
| # Copyright 2026 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}}' | ||||||
|
|
||||||
| import_format: | ||||||
| - 'projects/{{project}}/locations/{{location}}/dataProducts/{{data_product_id}}' | ||||||
| - '{{data_product_id}}' | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| 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))' | ||||||
|
|
||||||
| 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' | ||||||
|
Comment on lines
+80
to
+81
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
These can be removed due to |
||||||
| description: | | ||||||
| The ID of the data product. | ||||||
|
|
||||||
| properties: | ||||||
| - 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.' | ||||||
| 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 = ["[email protected]"] | ||
|
|
||
| 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you elaborate on why this is needed? Internally would be fine. |
||
| # failures and achieve a stable PASS for the core resource lifecycle. | ||
|
|
||
| provider = google-beta | ||
| } | ||
| 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 = ["[email protected]"] | ||
|
|
||
| access_groups { | ||
| id = "analyst" | ||
| group_id = "analyst" | ||
| display_name = "Data Analyst" | ||
| principal { | ||
| google_group = "[email protected]" | ||
| } | ||
| } | ||
|
|
||
| access_groups { | ||
| id = "scientist" | ||
| group_id = "scientist" | ||
| display_name = "Data Scientist" | ||
| principal { | ||
| google_group = "[email protected]" | ||
| } | ||
| } | ||
|
|
||
| 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 = ["[email protected]"] | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| access_groups { | ||||||
| id = "analyst" | ||||||
| group_id = "analyst" | ||||||
| display_name = "Data Analyst" | ||||||
| principal { | ||||||
| google_group = "tf-test-analysts-%{random_suffix}@example.com" | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| provider = google-beta | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add
referenceslinks here as well?