This page explains how to add, upgrade, and remove Cloud Storage buckets and BigQuery datasets as assets in existing Dataplex zones.
Overview
An asset maps to data stored in either Cloud Storage or BigQuery. You can map data stored in separate Google Cloud projects as assets into a single zone within a lake. You can attach existing Cloud Storage buckets or BigQuery datasets to be managed from within the lake.
Before you begin
If you haven't already, create a lake and a zone in that lake.
Most
gcloud lakes
commands require a location. You can specify the location by using the--location
flag.
Access control
To remove assets, grant the IAM roles containing the permissions
dataplex.lakes.delete
,dataplex.zones.delete
, ordataplex.assets.delete
IAM permissions. The Dataplex specificroles/dataplex.admin
androles/dataplex.editor
roles can be used to grant these permissions.To add assets, grant the IAM roles containing the permissions
create
-dataplex.lakes.create
,dataplex.zones.create
, ordataplex.assets.create
. Theroles/dataplex.admin
androles/dataplex.editor
roles contain these permissions.You can also give permission to users or groups by using the
roles/owner
androles/editor
legacy roles.You must authorize the Dataplex service on resources being attached to the Dataplex lake. The authorization is automatically and implicitly granted for resources in the project in which the lake is created. For other projects, authorize the Dataplex service on resources explicitly.
For more information, see Dataplex IAM and access control.
Grant roles for Cloud Storage buckets
To attach a Cloud Storage bucket from another project to your lake, you
must grant the Dataplex service account
(service-PROJECT_NUMBER@gcp-sa-dataplex.iam.gserviceaccount.com
,
retrieved from the lake details page in the console) the Dataplex
service account role (roles/dataplex.serviceAgent
) in the project that
contains the bucket. This role provides the
Dataplex service with the prerequisite administrator level role on the bucket so that
permissions can be set on the bucket itself.
Grant roles for BigQuery datasets
To attach a BigQuery dataset from another project to your lake, you must grant the Dataplex service account, the BigQuery Administrator role on the dataset.
VPC Service Controls considerations
Dataplex does not violate VPC Service Controls perimeters. Before adding an asset to the lake, be sure that the underlying bucket or dataset is in the same VPC Service Controls network as the lake.
For more information, See VPC Service Controls with Dataplex.
Add an asset
You can add a Cloud Storage bucket or a BigQuery dataset
asset by issuing a Dataplex API method
lakes.zones.assets.create
or adding a bucket or dataset on the Data zone page opened in a local browser.
If there is no overlap between the Dataplex lake region and one of the Cloud Storage buckets region, you cannot add the bucket to a zone in your lake.
To learn more about the region location of a Cloud Storage asset and how Dataplex handles the location of a bucket when creating the publishing dataset, see Regional resources.
Console
In the Google Cloud console, open the Dataplex page:
On the Manage page, click the lake to which you'd like to add a Cloud Storage bucket or BigQuery dataset. The lake page opens.
On the Zones tab, click the name of the data zone to which you'd like to add the asset. The Data zone page for that data zone opens.
On the Assets tab, click + Add Assets. The Add assets page opens.
Click Add an Asset.
In the Type field, and select either BigQuery dataset or Cloud Storage bucket.
In the Display name field, enter a name for the new asset.
In the ID field, enter a unique ID for the asset.
Optional: Enter a Description.
In the Dataset or Bucket field (based on the type of your asset), click Browse to find and select your Cloud Storage bucket or BigQuery dataset.
Optional: If your asset type is Cloud Storage bucket and if you want Dataplex to manage the asset, then select the Upgrade to Managed checkbox. If you choose this option, you don't have to upgrade the asset separately. This option is not available for BigQuery datasets.
Click Continue.
Choose the rest of the parameter values. For more information about security settings, see Lake security.
Click Submit to add the asset.
Verify that you have returned to the data zone page, and that your new asset appears in the assets list.
REST
Follow the API instructions to add a bucket by using the APIs Explorer.
When the addition succeeds, the data zone automatically enters active state. If it fails, then the data zone is rolled back to its previous healthy state.
Upgrade a Cloud Storage bucket asset
When you add an asset of type Cloud Storage bucket, Dataplex automatically publishes BigQuery external tables for the tables hosted in the asset.
When you upgrade a Cloud Storage bucket asset, Dataplex removes the attached external tables and creates BigLake tables. BigLake tables support better fine-grained security, including row-level, column-level, and dynamic data masking.
You can upgrade a Cloud Storage bucket asset in the Google Cloud console or by issuing the Dataplex API method Patch.
Console
In the Google Cloud console, open the Dataplex page:
On the Manage page, click the name of the lake. The lake page opens.
On the Zones tab, click the name of the data zone. The data zone page opens.
On the Assets tab, click the name of the asset that you'd like to upgrade.
Click Upgrade to Managed.
REST
Follow the API instructions to upgrade a bucket asset by using the Cloud Explorer.
Downgrade a Cloud Storage bucket asset
When you downgrade a Cloud Storage bucket asset, Dataplex removes the attached BigLake tables and creates external tables.
You can downgrade a Cloud Storage bucket asset in the Google Cloud console
or by issuing the Dataplex API method
Patch,
with the readAccessMode
field set to DIRECT
in
ResourceSpec
.
Console
In the Google Cloud console, open the Dataplex page:
On the Manage page, click the name of the lake. The lake page opens.
On the Zones tab, click the name of the data zone. The data zone page opens.
On the Assets tab, click the name of the asset that you'd like to upgrade.
Click Downgrade from Managed.
REST
Follow the API instructions to downgrade a bucket asset
by using the Cloud Explorer. Make sure that you set the readAccessMode
field to DIRECT
in
ResourceSpec
.
Remove an asset
You can remove a Cloud Storage bucket or BigQuery dataset
asset in the Google Cloud console or by issuing the Dataplex API
method lakes.zones.assets.delete
.
Remove the asset from the data zone or lake before attaching it to a
different one.
The following instructions demonstrate how to remove a Dataplex asset using the Google Cloud console or the Dataplex API.
Console
In the Google Cloud console, open the Dataplex page:
On the Manage page, click the lake from which you'd like to remove a Cloud Storage bucket or BigQuery dataset. The lake page for that lake opens.
On the Zones tab, click the name of the data zone you'd like to remove the Cloud Storage bucket or BigQuery dataset from. The Data zone page for that data zone opens.
On the Assets tab, select the asset by checking the box to the left of the asset name.
Click Delete Asset to remove the asset.
On the dialog, click Delete to confirm the detachment.
REST
Follow the API instructions to remove a bucket by using the Cloud Explorer.
What's next?
- Learn more about discovering data.
- Learn more about creating a lake.
- Learn more about Cloud Audit Logs.