Date: 2026-05-11
Time: 15:18
This page covers how to use FTL2 to provision and configure Google Cloud Platform (GCP) infrastructure. It explains setup (installing the google.cloud Ansible collection and Python dependencies), authentication methods (service account key or application default credentials), and the available GCP modules for managing compute, storage, SQL, and DNS resources — all accessed through FTL2's async automation pattern.
google.cloud Ansible collection for GCP automation — the same module ecosystem as Ansible, accessed via FTL2's async APIGCPAUTHKIND=serviceaccount) and application default credentials (GCPAUTHKIND=application)async with automation() and await ftl.google.cloud.<module>()"google.cloud.*") to cover all GCP modules at onceANSIBLECOLLECTIONSPATHSetup:
# Install collection into venv
ANSIBLE_COLLECTIONS_PATH=.venv/lib/python3.14/site-packages \
.venv/bin/ansible-galaxy collection install google.cloud
# Install Python auth/API dependencies
uv pip install google-auth google-cloud-compute google-api-python-client
Authentication (env vars):
# Service account
export GCP_AUTH_KIND=serviceaccount
export GCP_SERVICE_ACCOUNT_FILE=/path/to/service-account.json
# Application default credentials
export GCP_AUTH_KIND=application
gcloud auth application-default login
FTL2 usage pattern:
async with automation(secret_bindings={"google.cloud.*": {...}}) as ftl:
await ftl.google.cloud.gcp_compute_instance(name="vm", ...)
Example scripts: examplegcpprovision.py (creates VPC, subnet, firewall, GCE instance, nginx), examplegcpteardown.py (deletes all provisioned resources).
google.cloud Ansible collection — same FQCN module naming pattern as other cloud providers (e.g., AWS, Azure)async with automation() pattern as all other FTL2 modulesansible-galaxy collection install + ANSIBLECOLLECTIONSPATH approach as other Ansible-sourced collections in FTL2GCPAUTHKIND values are serviceaccount and application — know both and their corresponding setup stepsgoogle-auth, google-cloud-compute, google-api-python-clientANSIBLECOLLECTIONSPATH to the venv's site-packages directoryftl.google.cloud.gcpcomputeinstance(...) — not shorthand"google.cloud.*" to bind credentials to all GCP modules simultaneouslyawait) — consistent with FTL2's concurrency model