cloud-foundation-fabric/modules/dataplex
Ludovico Magnocavallo 789328ff5a
Bump provider versions to v5.0.0 (#1724)
* bump provider versions to 5.0.0

* fix cloud run, logging and vpc-sc

* Fix secret manager

* fix gke nodepool

* fix gke multitenant stage and blueprint

* Moving alloydb module to experimental.

* Add project to bare resources in examples

* tfdoc

* fix svpc blueprint test

* Revert "fix svpc blueprint test"

This reverts commit 14f02659098070136e64ead600580dd52c23c339.

* Fix GKE peering project

* Disable tests in alloydb module

* Bring back secret ids in secret manager tests

* Remove duplicate key

* last push

---------

Co-authored-by: Julio Castillo <jccb@google.com>
2023-10-03 12:15:36 +00:00
..
README.md rename cloud-dataplex to dataplex (#1546) 2023-07-29 14:31:18 +02:00
main.tf rename cloud-dataplex to dataplex (#1546) 2023-07-29 14:31:18 +02:00
outputs.tf rename cloud-dataplex to dataplex (#1546) 2023-07-29 14:31:18 +02:00
variables.tf rename cloud-dataplex to dataplex (#1546) 2023-07-29 14:31:18 +02:00
versions.tf Bump provider versions to v5.0.0 (#1724) 2023-10-03 12:15:36 +00:00

README.md

Dataplex instance with lake, zone & assests

This module manages the creation of Dataplex instance along with lake, zone & assets in single regions.

Simple example

This example shows how to setup a Dataplex instance, lake, zone & asset creation in GCP project.


module "dataplex" {
  source     = "./fabric/modules/dataplex"
  name       = "terraform-lake"
  prefix     = "test"
  project_id = "myproject"
  region     = "europe-west2"
  zones = {
    landing = {
      type      = "RAW"
      discovery = true
      assets = {
        gcs_1 = {
          resource_name          = "gcs_bucket"
          cron_schedule          = "15 15 * * *"
          discovery_spec_enabled = true
          resource_spec_type     = "STORAGE_BUCKET"
        }
      }
    },
    curated = {
      type      = "CURATED"
      discovery = false
      assets = {
        bq_1 = {
          resource_name          = "bq_dataset"
          cron_schedule          = null
          discovery_spec_enabled = false
          resource_spec_type     = "BIGQUERY_DATASET"
        }
      }
    }
  }
}

# tftest modules=1 resources=5

IAM

This example shows how to setup a Dataplex instance, lake, zone & asset creation in GCP project assigning IAM roles at lake and zone level.


module "dataplex" {
  source     = "./fabric/modules/dataplex"
  name       = "lake"
  prefix     = "test"
  project_id = "myproject"
  region     = "europe-west2"
  iam = {
    "roles/dataplex.viewer" = [
      "group:analysts@example.com",
      "group:analysts_sensitive@example.com"
    ]
  }
  zones = {
    landing = {
      type      = "RAW"
      discovery = true
      assets = {
        gcs_1 = {
          resource_name          = "gcs_bucket"
          cron_schedule          = "15 15 * * *"
          discovery_spec_enabled = true
          resource_spec_type     = "STORAGE_BUCKET"
        }
      }
    },
    curated = {
      type      = "CURATED"
      discovery = false
      iam = {
        "roles/viewer" = [
          "group:analysts@example.com",
          "group:analysts_sensitive@example.com"
        ]
        "roles/dataplex.dataReader" = [
          "group:analysts@example.com",
          "group:analysts_sensitive@example.com"
        ]
      }
      assets = {
        bq_1 = {
          resource_name          = "bq_dataset"
          cron_schedule          = null
          discovery_spec_enabled = false
          resource_spec_type     = "BIGQUERY_DATASET"
        }
      }
    }
  }
}

# tftest modules=1 resources=8

TODO

  • support multi-regions

Variables

name description type required default
name Name of Dataplex Lake. string
project_id The ID of the project where this Dataplex Lake will be created. string
region Region of the Dataplax Lake. string
zones Dataplex lake zones, such as RAW and CURATED. map(object({…}))
iam Dataplex lake IAM bindings in {ROLE => [MEMBERS]} format. map(list(string)) {}
location_type The location type of the Dataplax Lake. string "SINGLE_REGION"
prefix Optional prefix used to generate Dataplex Lake. string null

Outputs

name description sensitive
assets Assets attached to the lake of Dataplex Lake.
id Fully qualified Dataplex Lake id.
lake The lake name of Dataplex Lake.
zones The zone name of Dataplex Lake.