원클릭으로
agent-engine-terraform-deployer
Deploys ADK agents to Vertex AI Agent Engine using the standard Terraform pattern.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Deploys ADK agents to Vertex AI Agent Engine using the standard Terraform pattern.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Expert guide and patterns for building Agent-Driven User Interfaces (A2UI) using the ADK.
Specialized role for designing interactive Agent-Driven User Interfaces (A2UI). Understands agent interactions, selects appropriate UI components, and creates UX design documents without generating code.
Comprehensive guide to building, orchestrating, and deploying agents with the Google Agent Development Kit (ADK).
Deploys ADK agents to Vertex AI Agent Engine using the Python SDK and registers them with Gemini Enterprise.
Specialized role for registering and managing ADK agents within Gemini Enterprise using cURL.
specialized role for designing high-quality ADK agent architectures without generating code.
| name | Agent Engine Terraform Deployer |
| description | Deploys ADK agents to Vertex AI Agent Engine using the standard Terraform pattern. |
| mode | manual |
This skill helps you deploy your Agent Development Kit (ADK) agent to Vertex AI Agent Engine using a robust, self-contained Terraform pattern. It implements the "Golden Project Structure" and automated packaging logic recommended by the ADK team.
.ae_ignore, requirements.txt, and .env for deployment readiness.deploy/ directory with the golden main.tf template.app.py wrapper during deployment.v1.12.2v1.14.4roles/aiplatform.userroles/storage.objectViewerroles/serviceusage.serviceUsageConsumerroles/cloudtrace.agentAlways separate your deployment logic from your agent code. This prevents Terraform from accidentally zipping up its own bulky provider binaries.
my_project/
├── .ae_ignore # Patterns to exclude (caching, env files, etc.)
├── my_agent_package/ # YOUR AGENT FOLDER (must have __init__.py)
│ ├── agent.py # Root agent logic
│ ├── requirements.txt # Dependencies
│ └── ...
└── deploy/ # DEDICATED DEPLOYMENT FOLDER
└── main.tf # Self-contained Terraform logic
Ensure your agent's .env includes the following for proper observability:
# Enables agent traces and logs (excludes prompts/responses)
GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY=true
# Enables logging of input prompts and output responses
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true
Your agent's requirements.txt MUST include:
google-cloud-aiplatform[agent_engines,adk]
Instead of manually creating files, run the provided helper script. It will intelligently scan your agent directory and generate/update .ae_ignore, requirements.txt, and .env with the correct configurations.
# Run the preparation script pointing to your agent directory (replace /path/to/your/agent)
python3 scripts/prepare_agent.py /path/to/your/agent
This script will:
.ae_ignore (git, venve, terraform, *.zip, *.pkl, etc.).google-cloud-aiplatform[agent_engines,adk] to requirements.txt if missing..env if not present.Use this when you have the code on your machine.
mkdir -p deploy
# Copy templates/main_local.tf to deploy/main.tf
deploy/terraform.tfvars):
project_id = "your-project-id"
region = "us-central1"
agent_engine_name = "epp-telecom-concierge"
agent_folder_name = "epp_telecom_concierge"
cd deploy && terraform init && terraform apply
Use this to deploy code from a remote repository.
mkdir -p deploy
# Copy templates/main_github.tf to deploy/main.tf
deploy/terraform.tfvars):
project_id = "your-project-id"
region = "us-central1"
agent_engine_name = "epp-telecom-concierge"
github_repo = "username/repo"
github_branch = "main"
agent_package_name = "epp_telecom_concierge"
cd deploy && terraform init && terraform apply
The Issue: Terraform's inline_source (base64) has a strict limit. Including .terraform or .adk folders in your zip will trigger this.
The Solution: Use the EXCLUDES logic implemented in the templates and .ae_ignore to keep the archive under 100KB. The intelligent preparation script handles most of this for you.
The Issue: Agent Engine extracts your archive into /code/ and adds it to PYTHONPATH. If you don't preserve your package folder in the tarball (e.g., if you tar the contents of the folder instead of the folder itself), absolute imports like from my_package.agent import ... will fail.
The Solution: The templates in this skill always tar from the parent of your package directory (tar -C .. my_package/).
The Issue: You don't want AdkApp(agent=root_agent) in your dev code because it creates dependencies on Vertex SDK during local testing.
The Solution: The Terraform template generates a transient app.py wrapper that imports your agent only during the deployment phase. This keeps your business logic "pure."
The Issue: filebase64() fails if the file doesn't exist during the plan phase.
The Solution: We use data "external" instead of null_resource. Data sources run before resource evaluation, ensuring the archive is ready before Terraform checks its size/hash.
The Issue: Agent Engine creation fails (Error Code 3) if the service account roles haven't finished propagating.
The Solution: The CFF module includes a time_sleep. If you encounter "Error code 3" on the first run, simply retry terraform apply after a few minutes.
When deploying A2A agents that require OAuth (like A2UI), you must create an AGENT_AUTHORIZATION resource in Gemini Enterprise.
Before creating the authorization resource, the user must create a Web OAuth Client in the Google Cloud Console for the project.
https://vertexaisearch.cloud.google.com/oauth-redirecthttps://vertexaisearch.cloud.google.com/static/oauth/oauth.htmlConstruct the authorizationUri using the Client ID and the encoded redirect URI:
https://accounts.google.com/o/oauth2/v2/auth?client_id=<YOUR_CLIENT_ID>&redirect_uri=https%3A%2F%2Fvertexaisearch.cloud.google.com%2Fstatic%2Foauth%2Foauth.html&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&include_granted_scopes=true&response_type=code&access_type=offline&prompt=consent
Use curl with the Global Endpoint and include the X-Goog-User-Project header.
curl -X POST \
-H "Authorization: Bearer \$(gcloud auth application-default print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: <PROJECT_ID>" \
"https://global-discoveryengine.googleapis.com/v1alpha/projects/<PROJECT_ID>/locations/global/authorizations?authorizationId=<AUTH_ID>" \
-d '{
"name": "projects/<PROJECT_ID>/locations/global/authorizations/<AUTH_ID>",
"serverSideOauth2": {
"clientId": "<CLIENT_ID>",
"clientSecret": "<CLIENT_SECRET>",
"authorizationUri": "<AUTH_URI>",
"tokenUri": "<TOKEN_URI>"
}
}'
Replace <PROJECT_ID>, <AUTH_ID>, <CLIENT_ID>, <CLIENT_SECRET>, <AUTH_URI>, and <TOKEN_URI>.
[!CAUTION] Terraform deployments are NOT supported for A2UI agents in this repository. A2UI agents require a complex Custom Executor setup (to intercept streams and yield binary
DataPartobjects) which relies on Python Pickle-based deployments. Terraform uses Source-based (tar.gz) deployments and cannot support this natively.
If you need to deploy an A2UI agent, you MUST use the Python SDK Deployer.
Please refer to the Agent Engine Python Deployer skill for instructions on Pickle-based deployments.