[#3806] Fix Agent Engine class methods: update variable to optional(string) (#3808)

This commit is contained in:
Luca Prete
2026-03-25 11:02:19 +01:00
committed by GitHub
parent 03288f2b35
commit e33f2ba52d
6 changed files with 10 additions and 10 deletions

View File

@@ -352,7 +352,7 @@ The module allows you to dynamically reference context values for resources crea
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [agent_engine_config](variables.tf#L17) | The agent configuration. | <code title="object&#40;&#123;&#10; agent_framework &#61; string&#10; class_methods &#61; optional&#40;list&#40;any&#41;, &#91;&#93;&#41;&#10; container_concurrency &#61; optional&#40;number&#41;&#10; environment_variables &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; max_instances &#61; optional&#40;number&#41;&#10; min_instances &#61; optional&#40;number&#41;&#10; python_version &#61; optional&#40;string, &#34;3.13&#34;&#41;&#10; resource_limits &#61; optional&#40;object&#40;&#123;&#10; cpu &#61; string&#10; memory &#61; string&#10; &#125;&#41;&#41;&#10; secret_environment_variables &#61; optional&#40;map&#40;object&#40;&#123;&#10; secret_id &#61; string&#10; version &#61; optional&#40;string, &#34;latest&#34;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | ✓ | |
| [agent_engine_config](variables.tf#L17) | The agent configuration. | <code title="object&#40;&#123;&#10; agent_framework &#61; string&#10; class_methods &#61; optional&#40;string&#41;&#10; container_concurrency &#61; optional&#40;number&#41;&#10; environment_variables &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; max_instances &#61; optional&#40;number&#41;&#10; min_instances &#61; optional&#40;number&#41;&#10; python_version &#61; optional&#40;string, &#34;3.13&#34;&#41;&#10; resource_limits &#61; optional&#40;object&#40;&#123;&#10; cpu &#61; string&#10; memory &#61; string&#10; &#125;&#41;&#41;&#10; secret_environment_variables &#61; optional&#40;map&#40;object&#40;&#123;&#10; secret_id &#61; string&#10; version &#61; optional&#40;string, &#34;latest&#34;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | ✓ | |
| [name](variables.tf#L122) | The name of the agent. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L141) | The id of the project where to deploy the agent. | <code>string</code> | ✓ | |
| [region](variables.tf#L147) | The region where to deploy the agent. | <code>string</code> | ✓ | |

View File

@@ -36,9 +36,9 @@ resource "google_vertex_ai_reasoning_engine" "managed" {
spec {
agent_framework = var.agent_engine_config.agent_framework
class_methods = (
length(var.agent_engine_config.class_methods) > 0
? jsonencode(var.agent_engine_config.class_methods)
: null
var.agent_engine_config.class_methods == null
? null
: var.agent_engine_config.class_methods
)
service_account = local.service_account_email

View File

@@ -36,9 +36,9 @@ resource "google_vertex_ai_reasoning_engine" "unmanaged" {
spec {
agent_framework = var.agent_engine_config.agent_framework
class_methods = (
length(var.agent_engine_config.class_methods) > 0
? jsonencode(var.agent_engine_config.class_methods)
: null
var.agent_engine_config.class_methods == null
? null
: var.agent_engine_config.class_methods
)
service_account = local.service_account_email

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2025 Google LLC
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2025 Google LLC
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -19,7 +19,7 @@ variable "agent_engine_config" {
type = object({
# Add validation once API stabilizes
agent_framework = string
class_methods = optional(list(any), [])
class_methods = optional(string)
container_concurrency = optional(number)
environment_variables = optional(map(string), {})
max_instances = optional(number)