# Dataplex Aspect Types Module This module allows managing [Dataplex Aspect Types](https://cloud.google.com/dataplex/docs/enrich-entries-metadata) and their associated IAM bindings via variables and YAML files defined via a resource factory. The module manages Aspect Types for a single location in a single project. To manage them in different locations invoke the module multiple times, or use it with a `for_each` on locations/projects. - [Simple example](#simple-example) - [Factory example](#factory-example) - [Variables](#variables) - [Outputs](#outputs) ## Simple example This example mirrors the one in the [`google_dataplex_aspect_type`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dataplex_aspect_type) resource documentation, but also shows how to manage IAM on the single aspect type. More types can of course be defined by just adding them to the `aspect_types` map. ```hcl module "aspect-types" { source = "./fabric/modules/dataplex-aspect-types" project_id = "test-project" # var.location defaults to "global" # location = "global" aspect_types = { tf-test-template = { display_name = "Test template." iam = { "roles/dataplex.aspectTypeOwner" = ["group:data-owners@example.com"] } iam_bindings_additive = { user = { role = "roles/dataplex.aspectTypeUser" member = "serviceAccount:sa-0@test-project.iam.gserviceaccount.com" } } metadata_template = < ## Variables | name | description | type | required | default | |---|---|:---:|:---:|:---:| | [project_id](variables.tf#L77) | Project id where resources will be created. | string | ✓ | | | [aspect_types](variables.tf#L17) | Aspect templates. Merged with those defined via the factory. | map(object({…})) | | {} | | [context](variables.tf#L48) | Context-specific interpolations. | object({…}) | | {} | | [factories_config](variables.tf#L61) | Paths to folders for the optional factories. | object({…}) | | {} | | [location](variables.tf#L70) | Location for aspect types. | string | | "global" | ## Outputs | name | description | sensitive | |---|---|:---:| | [ids](outputs.tf#L17) | Aspect type IDs. | | | [names](outputs.tf#L29) | Aspect type names. | | | [timestamps](outputs.tf#L41) | Aspect type create and update timestamps. | | | [uids](outputs.tf#L56) | Aspect type globally unique IDs. | |