* 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>
Managed Kafka Module
This module allows simplified creation and management of Google Cloud Managed Kafka clusters, including topics, Kafka Connect clusters, and connectors.
TOC
Simple Cluster Example
This example creates a basic Managed Kafka cluster.
module "kafka-cluster" {
source = "./fabric/modules/managed-kafka"
project_id = var.project_id
location = var.regions.primary
cluster_id = "my-kafka-cluster"
capacity_config = {
vcpu_count = 3
memory_bytes = 3221225472 # 3 GiB
}
subnets = [
var.subnets.primary.id
]
labels = {
environment = "development"
}
}
# tftest modules=1 resources=1 inventory=simple.yaml
Cluster with Topics
This example creates a Managed Kafka cluster along with predefined topics.
module "kafka-cluster-with-topics" {
source = "./fabric/modules/managed-kafka"
project_id = var.project_id
location = "europe-west1"
cluster_id = "my-kafka-cluster-topics"
capacity_config = {
vcpu_count = 6
memory_bytes = 6442450944 # 6 GiB
}
subnets = [var.subnets.primary.id]
topics = {
topic-a = {
partition_count = 3
replication_factor = 3
configs = {
"cleanup.policy" = "delete"
}
}
topic-b = {
partition_count = 6
replication_factor = 3
}
}
}
# tftest modules=1 resources=3 inventory=topics.yaml
Cluster with Kafka Connect
This example demonstrates creating a Kafka cluster, a Kafka Connect cluster, and a connector. Note that Connect resources require the google-beta provider.
module "gcs" {
source = "./fabric/modules/gcs"
project_id = var.project_id
location = var.region
name = "gmk-sink"
prefix = var.prefix
}
module "vpc" {
source = "./fabric/modules/net-vpc"
project_id = var.project_id
name = "vpc"
subnets = [
{
ip_cidr_range = "10.0.0.0/20"
name = "subnet1"
region = var.region
},
{
ip_cidr_range = "10.0.16.0/20"
name = "subnet2"
region = var.region
},
{
ip_cidr_range = "10.0.32.0/20"
name = "subnet3"
region = var.region
},
]
}
module "kafka-cluster-with-connect" {
source = "./fabric/modules/managed-kafka"
project_id = var.project_id
location = var.region
cluster_id = "my-kafka-cluster-connect"
capacity_config = {
vcpu_count = 3
memory_bytes = 3221225472 # 3 GiB
}
subnets = [
module.vpc.subnet_ids["${var.region}/subnet1"]
]
connect_clusters = {
my-connect-cluster = {
vcpu_count = 3
memory_bytes = 3221225472 # 3 GiB
primary_subnet = module.vpc.subnet_ids["${var.region}/subnet1"]
additional_subnets = [
module.vpc.subnet_ids["${var.region}/subnet2"],
module.vpc.subnet_ids["${var.region}/subnet3"]
]
}
}
connect_connectors = {
my-gcs-connector = {
connect_cluster = "my-connect-cluster"
configs = {
"connector.class" = "io.aiven.kafka.connect.gcs.GcsSinkConnector"
"file.name.prefix" = ""
"format.output.type" = "json"
"gcs.bucket.name" = module.gcs.name
"gcs.credentials.default" = "true"
"key.converter" = "org.apache.kafka.connect.storage.StringConverter"
"tasks.max" = "3"
"topics" = "topic1"
"value.converter" = "org.apache.kafka.connect.json.JsonConverter"
"value.converter.schemas.enable" = "false"
}
task_restart_policy = {
minimum_backoff = "60s"
maximum_backoff = "300s"
}
}
}
}
# tftest modules=3 resources=11 inventory=connect.yaml
Variables
| name | description | type | required | default |
|---|---|---|---|---|
| capacity_config | Capacity configuration for the Kafka cluster. | object({…}) |
✓ | |
| cluster_id | The ID of the Kafka cluster. | string |
✓ | |
| location | The GCP region for the Kafka cluster. | string |
✓ | |
| project_id | The ID of the project where the Kafka cluster will be created. | string |
✓ | |
| subnets | List of VPC subnets for the Kafka cluster network configuration. | list(string) |
✓ | |
| connect_clusters | Map of Kafka Connect cluster configurations to create. | map(object({…})) |
{} |
|
| connect_connectors | Map of Kafka Connect Connectors to create. | map(object({…})) |
{} |
|
| kms_key | Customer-managed encryption key (CMEK) used for the Kafka cluster. | string |
null |
|
| labels | Labels to apply to the Kafka cluster. | map(string) |
null |
|
| rebalance_mode | Rebalancing mode for the Kafka cluster. | string |
null |
|
| topics | Map of Kafka topics to create within the cluster. | map(object({…})) |
{} |
Outputs
| name | description | sensitive |
|---|---|---|
| connect_cluster_ids | Map of Kafka Connect cluster IDs. | |
| connect_connectors | Map of Kafka Connect Connector IDs. | |
| id | The ID of the Managed Kafka cluster. | |
| topic_ids | Map of Kafka topic IDs. |