This tutorial gives Porter access to your Google Cloud project using Workload Identity Federation — no service account keys, no long-lived credentials. Setup takes about 30 seconds.
Click main.tf to inspect every resource this tutorial creates in your project. The summary:
- Five APIs enabled: Cloud Resource Manager, IAM, IAM Credentials, Security Token Service, and Service Usage. These are the ones needed to federate. Porter enables the rest (Compute, Kubernetes Engine, Artifact Registry, Container Registry, Secret Manager) afterward, server-side.
- Service account
porter-manager@<project>.iam.gserviceaccount.comwith the bootstrap IAM roles needed to provision the rest of Porter's setup:serviceUsageAdmin,projectIamAdmin, andserviceAccountAdmin. Porter grants the heavier per-service roles itself afterward. - Workload Identity Pool
porter-poolwith an AWS provider that trusts only Porter's cluster control plane role for only your tenant. - Impersonation grant allowing the federated identity to act as the service account.
Every resource is labeled managed-by=porter so you can find them later via
GCP Asset Inventory.
Porter has provided you with three values. They should already be set in your shell as environment variables. Confirm they match what you expect:
echo "Project: ${PORTER_PROJECT_ID:-}" echo "Tenant ID: ${PORTER_TENANT_EXTERNAL_ID:-}" echo "Porter AWS account: ${PORTER_AWS_ACCOUNT_ID:-}"If any of those are empty, return to the Porter dashboard and copy the setup command from the Connect Google Cloud screen — it sets these for you.
This invokes Terraform inside Cloud Shell. State is stored in a small GCS
bucket in your project (porter-tfstate-<project-id>) so revocation later is
deterministic.
Terraform will print the plan and apply it. You'll see green checks for each of the few resources it creates.
The Porter dashboard has been polling for completion since you started. As soon as the federation works, Porter takes over server-side: enables the remaining APIs and grants the remaining IAM roles. The dashboard's progress bar climbs to 100% and the cluster creation flow advances automatically.
If the dashboard does not advance within 30 seconds of Terraform completing: click Retry verification in Porter, or see the troubleshooting section in the README.
To remove Porter's access later:
- In Porter: Integrations → Google Cloud → Revoke. This opens a Cloud
Shell tutorial that runs
terraform destroyagainst the same state. - Or directly: delete the
porter-poolWorkload Identity Pool in IAM & Admin → Workload Identity Federation. That single action invalidates all federated tokens immediately.
You can close this tab now. Porter is ready.