google.cloud.gcp_vertexai_reasoning_engine module – Creates a GCP VertexAI.ReasoningEngine resource
Note
This module is part of the google.cloud collection (version 1.13.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install google.cloud. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: google.cloud.gcp_vertexai_reasoning_engine.
Synopsis
- ReasoningEngine provides a customizable runtime for models to determine which actions to take and in which order.
Requirements
The below requirements are needed on the host that executes this module.
- python >= 3.8
- requests >= 2.18.4
- google-auth >= 2.25.1
Parameters
Parameter | Comments |
|---|---|
access_token string | The access token used to authenticate. |
auth_kind string / required | The type of credential used. Choices:
|
description string | The description of the ReasoningEngine. |
display_name string / required | The display name of the ReasoningEngine. |
encryption_spec dictionary | Customer-managed encryption key spec for a ReasoningEngine. If set, this ReasoningEngine and all sub-resources of this ReasoningEngine will be secured by this key. |
|
kms_key_name string / required |
The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key. The key needs to be in the same region as where the compute resource is created. |
env_type string | Specifies which Ansible environment you’re running this module within. This should not be set unless you know what you’re doing. This only alters the User Agent string for any API requests. |
project string | The Google Cloud Platform project to use. |
region string | The region of the reasoning engine. eg us-central1. |
scopes list / elements=string | Array of scopes to be used. |
service_account_contents jsonarg | The contents of a Service Account JSON file, either in a dictionary or as a JSON string that represents it. |
service_account_email string | An optional service account email address if machineaccount is selected and the user does not wish to use the default email. |
service_account_file path | The path of a Service Account JSON file if serviceaccount is selected as type. |
spec dictionary | Configurations of the ReasoningEngine. |
|
agent_framework string |
The OSS agent framework used to develop the agent. |
|
class_methods string |
Declarations for object class methods in OpenAPI specification format. |
|
deployment_spec dictionary |
The specification of a Reasoning Engine deployment. |
|
container_concurrency integer |
Concurrency for each container and agent server. Recommended value: 2 * cpu + 1. Defaults to 9. |
|
env list / elements=dictionary |
Environment variables to be set with the Reasoning Engine deployment. |
|
name string / required |
The name of the environment variable. Must be a valid C identifier. |
|
value string / required |
Variables that reference a $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. |
|
max_instances integer |
The maximum number of application instances that can be launched to handle increased traffic. Defaults to 100. Range: [1, 1000]. If VPC-SC or PSC-I is enabled, the acceptable range is [1, 100]. |
|
min_instances integer |
The minimum number of application instances that will be kept running at all times. Defaults to 1. Range: [0, 10]. |
|
psc_interface_config dictionary |
Configuration for PSC-Interface. |
|
dns_peering_configs list / elements=dictionary |
DNS peering configurations. When specified, Vertex AI will attempt to configure DNS peering zones in the tenant project VPC to resolve the specified domains using the target network’s Cloud DNS. The user must grant the dns.peer role to the Vertex AI service Agent on the target project. |
|
domain string / required |
The DNS name suffix of the zone being peered to, e.g., “my-internal-domain.corp.”. Must end with a dot. |
|
target_network string / required |
The VPC network name in the targetProject where the DNS zone specified by ‘domain’ is visible. |
|
target_project string / required |
The project id hosting the Cloud DNS managed zone that contains the ‘domain’. The Vertex AI service Agent requires the dns.peer role on this project. |
|
network_attachment string |
The name of the Compute Engine network attachment to attach to the resource within the region and user project. To specify this field, you must have already created a network attachment. This field is only used for resources using PSC-Interface. |
|
resource_limits dictionary |
Resource limits for each container. Only ‘cpu’ and ‘memory’ keys are supported. Defaults to {“cpu”: “4”, “memory”: “4Gi”}. The only supported values for CPU are ‘1’, ‘2’, ‘4’, ‘6’ and ‘8’. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. The only supported values for memory are ‘1Gi’, ‘2Gi’, .. ‘32 Gi’. For more information, go to https://cloud.google.com/run/docs/configuring/memory-limits. |
|
secret_env list / elements=dictionary |
Environment variables where the value is a secret in Cloud Secret Manager. To use this feature, add ‘Secret Manager Secret Accessor’ role (roles/secretmanager.secretAccessor) to AI Platform Reasoning Engine service Agent. |
|
name string / required |
The name of the environment variable. Must be a valid C identifier. |
|
secret_ref dictionary / required |
Reference to a secret stored in the Cloud Secret Manager that will provide the value for this environment variable. |
|
secret string / required |
The name of the secret in Cloud Secret Manager. Format: {secret_name}. |
|
version string |
The Cloud Secret Manager secret version. Can be ‘latest’ for the latest version, an integer for a specific version, or a version alias. |
|
package_spec dictionary |
User provided package spec of the ReasoningEngine. Ignored when users directly specify a deployment image through deploymentSpec.first_party_image_override, but keeping the field_behavior to avoid introducing breaking changes. |
|
dependency_files_gcs_uri string |
The Cloud Storage URI of the dependency files in tar.gz format. |
|
pickle_object_gcs_uri string |
The Cloud Storage URI of the pickled python object. |
|
python_version string |
The Python version. Currently support 3.8, 3.9, 3.10, 3.11, 3.12, 3.13. If not specified, default value is 3.10. |
|
requirements_gcs_uri string |
The Cloud Storage URI of the requirements.txtfile. |
|
service_account string |
The service account that the Reasoning Engine artifact runs as. It should have “roles/storage.objectViewer” for reading the user project’s Cloud Storage and “roles/aiplatform.user” for using Vertex extensions. If not specified, the Vertex AI Reasoning Engine service Agent in the project will be used. |
|
source_code_spec dictionary |
Specification for deploying from source code. |
|
inline_source dictionary |
Source code is provided directly in the request. |
|
source_archive string |
Input only. The application source code archive, provided as a compressed tarball (.tar.gz) file. A base64-encoded string. |
|
python_spec dictionary |
Specification for running a Python application from source. |
|
entrypoint_module string |
The Python module to load as the entrypoint, specified as a fully qualified module name. For example: path.to.agent. If not specified, defaults to “agent”. The project root will be added to Python sys.path, allowing imports to be specified relative to the root. |
|
entrypoint_object string |
The name of the callable object within the entrypointModule to use as the application If not specified, defaults to “root_agent”. |
|
requirements_file string |
The path to the requirements file, relative to the source root. If not specified, defaults to “requirements.txt”. |
|
version string |
The version of Python to use. Support version includes 3.9, 3.10, 3.11, 3.12, 3.13. If not specified, default value is 3.10. |
state string | Whether the resource should exist in GCP. Choices:
|
Notes
Note
- API Reference: https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.reasoningEngines/
- Develop and deploy agents on Vertex AI Agent Engine Guide: https://cloud.google.com/vertex-ai/generative-ai/docs/agent-engine/quickstart
- For authentication, you can set auth_kind using the
GCP_AUTH_KINDenv variable. - For authentication, you can set service_account_file using the
GCP_SERVICE_ACCOUNT_FILEenv variable. - For authentication, you can set service_account_contents using the
GCP_SERVICE_ACCOUNT_CONTENTSenv variable. - For authentication, you can set service_account_email using the
GCP_SERVICE_ACCOUNT_EMAILenv variable. - For authentication, you can set access_token using the
GCP_ACCESS_TOKENenv variable. - For authentication, you can set scopes using the
GCP_SCOPESenv variable. - Environment variables values will only be used if the playbook values are not set.
- The
service_account_email,service_account_file,service_account_fileandaccess_tokenoptions are mutually exclusive.
Examples
- name: Create Basic Reasoning Engine
google.cloud.gcp_vertexai_reasoning_engine:
state: present
display_name: basic-reasoning-engine
description: A Basic Reasoning Engine
region: us-central1
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
################################################################################
- name: Create Source Based Deployment Reasoning Engine
google.cloud.gcp_vertexai_reasoning_engine:
state: present
display_name: source-based-deployment-reasoning-engine
description: A Source Based Deployment Reasoning Engine
region: us-central1
spec:
source_code_spec:
inline_source:
source_archive: "{{ slurped_tarball.content }}" # slurp already returns b64
# source_archive: "{{ some_other_b64_encoded_string }}"
python_spec:
entrypoint_module: my_agent
entrypoint_object: name_generator
requirements_file: prod-requirements.txt # defaults to requirements.txt
version: "3.11"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
changed boolean | Whether the resource was changed. Returned: always |
createTime string | The timestamp of when the Index was created in RFC3339 UTC “Zulu” format, with nanosecond resolution and up to nine fractional digits. Returned: success |
name string | The generated name of the ReasoningEngine, in the format projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}. Returned: success |
state string | The current state of the resource. Returned: always |
updateTime string | The timestamp of when the Index was last updated in RFC3339 UTC “Zulu” format, with nanosecond resolution and up to nine fractional digits. Returned: success |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/google/cloud/gcp_vertexai_reasoning_engine_module.html