What Formal Discovers
Cloud SQL Autodiscovery
Cloud SQL Autodiscovery
Discover Cloud SQL for PostgreSQL and MySQL instances and add them as Formal
resources.
GKE Autodiscovery
GKE Autodiscovery
Discover GKE clusters for Kubernetes access control. Clusters need a public
endpoint to be discovered.
Compute Engine Autodiscovery
Compute Engine Autodiscovery
Discover Compute Engine instances for SSH access.
Cloud Storage Log Delivery
Cloud Storage Log Delivery
Forward Formal Connector logs to GCS buckets for long-term storage and
compliance.
Architecture
Theterraform-formal-gcp module enables the required APIs (IAM, STS, IAM Credentials, Cloud Resource Manager) and creates:
- Workload Identity Pool: a pool with an AWS-type provider that trusts Formal’s AWS account
- Attribute Condition: pins Formal’s per-integration role ARN, so only that exact role can exchange a token
- Service Account: the identity Formal impersonates in your project
- IAM Bindings: grant the service account only the roles for the capabilities you enable, such as
compute.viewer,container.viewer, andcloudsql.viewerfor discovery, andstorage.objectCreatorfor log delivery
Setup
- Web Console
- Terraform
1
Navigate to Cloud Accounts
Go to Cloud Accounts
2
Add Integration
Click Add Integration and choose GCP
3
Enter Details
Enter a name and the Google Cloud project ID to connect
4
Choose Discovery
Toggle autodiscovery for Compute Engine, GKE, and Cloud SQL. All are on by default.
5
Configure GCS Access
To deliver logs to Cloud Storage, enable GCS log writes. Leave the bucket list empty to allow every bucket in the project, or name specific buckets to scope access.
6
Run the Setup Command
Formal shows a command with your integration ID and security key filled in. Paste it into an authenticated Cloud Shell for that project:It fetches the setup parameters from Formal, runs
terraform apply, then reports the service account and workload identity pool provider back to Formal, which activates the integration.Cloud Storage Log Delivery
To forward logs to GCS, the integration needs Cloud Storage access. Enable it when creating the integration with two settings:
Formal grants matching IAM: a project-level
roles/storage.objectCreator when the bucket list is empty, or per-bucket IAM bindings when you restrict it.
Once access is granted, create a Log Integration pointing at a bucket to start forwarding logs.
Security
- Federated, keyless: no service account keys are created or stored.
- Pinned role: the pool’s attribute condition trusts only Formal’s exact per-integration role ARN.
- Least privilege: the service account gets only the roles for the capabilities you enable; disabling every capability connects the project with no access.
- Bucket scoping: restrict
gcs_bucketsso Formal can write only to the buckets you name.
Troubleshooting
Setup command fails
Setup command fails
Possible causes:
- The Cloud Shell is not authenticated to the target project
- The account lacks permission to enable APIs or create IAM resources
- The integration ID or security key is wrong
- Run
gcloud config set project <PROJECT_ID>in the Cloud Shell - Ensure the account has
roles/owneror an equivalent set of IAM and Service Usage roles - Copy the exact command Formal shows when you create the integration
Resources not discovered
Resources not discovered
Possible causes:
- Autodiscovery disabled for that resource type
- GKE cluster has no public endpoint
- Cloud SQL instance is neither PostgreSQL nor MySQL
- Service account missing the viewer role
- Verify the discovery toggle is enabled on the Cloud Account
- Confirm the cluster exposes a public endpoint
- Re-run the setup command so the module grants the viewer roles
- Wait a few minutes for the initial scan
GCS log forwarding not working
GCS log forwarding not working
Possible causes:
- Cloud Storage access not enabled on the integration
- The target bucket is not in the
gcs_bucketsallowlist - Log integration not configured
- Confirm
allow_gcs_accessis enabled on the Cloud Account - Add the bucket to
gcs_buckets, or leave the list empty to allow all buckets - Create a Log Integration pointing to this cloud integration
Next Steps
Log Integration
Forward logs to Cloud Storage
Add Resources
Manually configure discovered resources
Terraform
Manage integrations as code
View Resources
See all autodiscovered resources