google_dataplex_asset

The Dataplex Asset resource

Example Usage - basic_asset

resource "google_storage_bucket" "basic_bucket" {
  name          = "bucket"
  location      = "us-west1"
  uniform_bucket_level_access = true
  lifecycle {
    ignore_changes = [
      labels
    ]
  }

  project = "my-project-name"
}

resource "google_dataplex_lake" "basic_lake" {
  name         = "lake"
  location     = "us-west1"
  project = "my-project-name"
}


resource "google_dataplex_zone" "basic_zone" {
  name         = "zone"
  location     = "us-west1"
  lake = google_dataplex_lake.basic_lake.name
  type = "RAW"

  discovery_spec {
    enabled = false
  }


  resource_spec {
    location_type = "SINGLE_REGION"
  }

  project = "my-project-name"
}


resource "google_dataplex_asset" "primary" {
  name          = "asset"
  location      = "us-west1"

  lake = google_dataplex_lake.basic_lake.name
  dataplex_zone = google_dataplex_zone.basic_zone.name

  discovery_spec {
    enabled = false
  }

  resource_spec {
    name = "projects/my-project-name/buckets/bucket"
    type = "STORAGE_BUCKET"
  }

  labels = {
    env     = "foo"
    my-asset = "exists"
  }


  project = "my-project-name"
  depends_on = [
    google_storage_bucket.basic_bucket
  ]
}

Argument Reference

The following arguments are supported:

The discovery_spec block supports:

The resource_spec block supports:


Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

The csv_options block supports:

The json_options block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Asset can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Asset using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{dataplex_zone}}/assets/{{name}}"
  to = google_dataplex_asset.default
}

When using the terraform import command, Asset can be imported using one of the formats above. For example:

$ terraform import google_dataplex_asset.default projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{dataplex_zone}}/assets/{{name}}
$ terraform import google_dataplex_asset.default {{project}}/{{location}}/{{lake}}/{{dataplex_zone}}/{{name}}
$ terraform import google_dataplex_asset.default {{location}}/{{lake}}/{{dataplex_zone}}/{{name}}