cloud-foundation-fabric/modules/dataplex
Ludovico Magnocavallo 6941313c7d
Factories refactor (#1843)
* factories refactor doc

* Adds file schema and filesystem organization

* Update 20231106-factories.md

* move factories out of blueprints and create new factories  README

* align factory in billing-account module

* align factory in dataplex-datascan module

* align factory in billing-account module

* align factory in net-firewall-policy module

* align factory in dns-response-policy module

* align factory in net-vpc-firewall module

* align factory in net-vpc module

* align factory variable names in FAST

* remove decentralized firewall blueprint

* bump terraform version

* bump module versions

* update top-level READMEs

* move project factory to modules

* fix variable names and tests

* tfdoc

* remove changelog link

* add project factory to top-level README

* fix cludrun eventarc diff

* fix README

* fix cludrun eventarc diff

---------

Co-authored-by: Simone Ruffilli <sruffilli@google.com>
2024-02-26 10:16:52 +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 Factories refactor (#1843) 2024-02-26 10:16:52 +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.