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.12.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 |
|---|---|
The access token used to authenticate. |
|
The type of credential used. Choices:
|
|
The description of the ReasoningEngine. |
|
The display name of the ReasoningEngine. |
|
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. |
|
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. |
|
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. |
|
The Google Cloud Platform project to use. |
|
The region of the reasoning engine. eg us-central1. |
|
Array of scopes to be used. |
|
The contents of a Service Account JSON file, either in a dictionary or as a JSON string that represents it. |
|
An optional service account email address if machineaccount is selected and the user does not wish to use the default email. |
|
The path of a Service Account JSON file if serviceaccount is selected as type. |
|
Configurations of the ReasoningEngine. |
|
The OSS agent framework used to develop the agent. |
|
Declarations for object class methods in OpenAPI specification format. |
|
The specification of a Reasoning Engine deployment. |
|
Concurrency for each container and agent server. Recommended value: 2 * cpu + 1. Defaults to 9. |
|
Environment variables to be set with the Reasoning Engine deployment. |
|
The name of the environment variable. Must be a valid C identifier. |
|
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. |
|
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]. |
|
The minimum number of application instances that will be kept running at all times. Defaults to 1. Range: [0, 10]. |
|
Configuration for PSC-Interface. |
|
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. |
|
The DNS name suffix of the zone being peered to, e.g., “my-internal-domain.corp.”. Must end with a dot. |
|
The VPC network name in the targetProject where the DNS zone specified by ‘domain’ is visible. |
|
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. |
|
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 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. |
|
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. |
|
The name of the environment variable. Must be a valid C identifier. |
|
Reference to a secret stored in the Cloud Secret Manager that will provide the value for this environment variable. |
|
The name of the secret in Cloud Secret Manager. Format: {secret_name}. |
|
The Cloud Secret Manager secret version. Can be ‘latest’ for the latest version, an integer for a specific version, or a version alias. |
|
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. |
|
The Cloud Storage URI of the dependency files in tar.gz format. |
|
The Cloud Storage URI of the pickled python object. |
|
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. |
|
The Cloud Storage URI of the requirements.txtfile. |
|
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. |
|
Specification for deploying from source code. |
|
Source code is provided directly in the request. |
|
Input only. The application source code archive, provided as a compressed tarball (.tar.gz) file. A base64-encoded string. |
|
Specification for running a Python application from source. |
|
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. |
|
The name of the callable object within the entrypointModule to use as the application If not specified, defaults to “root_agent”. |
|
The path to the requirements file, relative to the source root. If not specified, defaults to “requirements.txt”. |
|
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. |
|
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 |
|---|---|
Whether the resource was changed. Returned: always |
|
The timestamp of when the Index was created in RFC3339 UTC “Zulu” format, with nanosecond resolution and up to nine fractional digits. Returned: success |
|
The generated name of the ReasoningEngine, in the format projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}. Returned: success |
|
The current state of the resource. Returned: always |
|
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 |