Files
hunfabric/modules/dataplex-aspect-types
Hemanand eaa420534b Add agent engine BYOC support (#3885)
* feat(agent-engine): add support for container and custom image specs

- Add container_config to deployment_files.
- Add image_spec with build_args to source_config.
- Make agent_framework optional and document supported values.
- Implement dynamic specs for container and source deployments.
- Add examples and automated tests for new deployment types.

* chore: update Google provider version to 7.28.0 across modules

Mechanical update of versions.tf and versions.tofu files using tools/versions.py.

* feat(agent-engine): refactor for container deployments and API alignment

- Group deployment settings under 'deployment_config' (renamed from 'deployment_files').
- Support container-based deployments via 'container_config' and 'image_spec'.
- Refactor 'source_files_config' (renamed from 'source_config') to include mutually exclusive 'python_spec' and 'image_spec'.
- Support 'developer_connect_config' as a source code type.
- Group engine settings (framework, env, secrets) under 'agent_engine_config'.
- Add support for 'memory_bank_config' persistent memory.
- Overhaul reasoning engine resources with dynamic blocks to match provider schema.
- Update all documentation examples, add TOC, and refresh test inventories.

* Update dynamic python_spec block and related example yamls

* Ignore changes setting for developer_connect_source under lifecycle management

* fixing review comments for `try` and default path for `source_path`

---------

Co-authored-by: Hemanand <hemr@google.com>
Co-authored-by: Julio Castillo <jccb@google.com>
2026-04-21 17:46:20 +00:00
..
2026-04-18 10:07:14 +02:00
2025-10-26 11:56:41 +01:00

Dataplex Aspect Types Module

This module allows managing Dataplex Aspect Types 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

This example mirrors the one in the google_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.

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 = <<END
      {
        "name": "tf-test-template",
        "type": "record",
        "recordFields": [
          {
            "name": "type",
            "type": "enum",
            "annotations": {
              "displayName": "Type",
              "description": "Specifies the type of view represented by the entry."
            },
            "index": 1,
            "constraints": {
              "required": true
            },
            "enumValues": [
              {
                "name": "VIEW",
                "index": 1
              }
            ]
          }
        ]
      }
      END
    }
  }
}
# tftest modules=1 resources=3

Factory example

Aspect types can also be defined via a resource factory, where the file name will be used as the aspect type id. The resulting data is then internally combined with the aspect_types variable.

IAM attributes can leverage substitutions for principals, which need to be defined via the factories_configs.context.iam_principals variable as shown in the example below.

module "aspect-types" {
  source     = "./fabric/modules/dataplex-aspect-types"
  project_id = "test-project"
  context = {
    iam_principals = {
      test-sa = "serviceAccount:sa-0@test-project.iam.gserviceaccount.com"
    }
  }
  factories_config = {
    aspect_types = "data/aspect-types"
  }
}
# tftest modules=1 resources=4 files=aspect-0,aspect-1
display_name: "Test template 0."
iam:
  "roles/dataplex.aspectTypeOwner":
    - group:data-owners@example.com
metadata_template: |
  {
    "name": "tf-test-template-0",
    "type": "record",
    "recordFields": [
      {
        "name": "type",
        "type": "enum",
        "annotations": {
          "displayName": "Type",
          "description": "Specifies the type of view represented by the entry."
        },
        "index": 1,
        "constraints": {
          "required": true
        },
        "enumValues": [
          {
            "name": "VIEW",
            "index": 1
          }
        ]
      }
    ]
  }
# tftest-file id=aspect-0 path=data/aspect-types/aspect-0.yaml schema=aspect-type.schema.json
display_name: "Test template 1."
iam_bindings_additive:
  user:
    role: roles/dataplex.aspectTypeUser
    member: $iam_principals:test-sa
metadata_template: |
  {
    "name": "tf-test-template-1",
    "type": "record",
    "recordFields": [
      {
        "name": "type",
        "type": "enum",
        "annotations": {
          "displayName": "Type",
          "description": "Specifies the type of view represented by the entry."
        },
        "index": 1,
        "constraints": {
          "required": true
        },
        "enumValues": [
          {
            "name": "VIEW",
            "index": 1
          }
        ]
      }
    ]
  }
# tftest-file id=aspect-1 path=data/aspect-types/aspect-1.yaml schema=aspect-type.schema.json

Variables

name description type required default
project_id Project id where resources will be created. string
aspect_types Aspect templates. Merged with those defined via the factory. map(object({…})) {}
context Context-specific interpolations. object({…}) {}
factories_config Paths to folders for the optional factories. object({…}) {}
location Location for aspect types. string "global"

Outputs

name description sensitive
ids Aspect type IDs.
names Aspect type names.
timestamps Aspect type create and update timestamps.
uids Aspect type globally unique IDs.