EYOX · Platform · Terraform groundwork

Terraform for the Eyox Google Cloud setup

One place to see and change the whole Google Cloud setup. First every project is copied into code as it is, with imports only and zero changes; after that, every change is a pull request and nobody changes the cloud by hand.

⚠ Nothing applied yet GitHub Actions, no stored keys Terraform 1.17.3 · Google provider 8.12.0

From pull request to Production

Scroll sideways to see every column.

On every push the plan covers each changed folder and, side by side, the Dev apply covers each changed Dev folder. Dev also goes back to main when such a pull request closes without merging, or when someone starts the Dev workflow by hand on main.

Every apply

Plan→ Guardrefuses risky changes→ Apply→ Plan againmust show no changes
Staging and Production also: only the current head of main only Ruben or Ike first run attempt only one apply at a time

What the guard lets through

The plan wants toWhile a folder is copiedDevStaging and Production
Import without changes✓ Yes✓ Yes✓ Yes
Create or change something✕ No✓ Yes✓ Yes
Delete or replace a database, bucket, disk, secret or machine✕ No✓ Yes⚠ Only if named
Weaken backups, versioning or deletion protection✕ No✓ Yes⚠ Only if named
Let an API switch off when it is removed from the code✕ No✕ No✕ No

Scroll sideways to see every column.

"Named": the person starting the apply lists the exact resource. Dev may lose anything, so it can always go back to main.

Who reaches what

IdentityDev projectsStaging and Production projectsOrganisation and billingDev stateStaging stateProd state
terraform-planplan and drift checkReadReadReadReadReadRead
terraform-apply-devDev workflowReadwrite after the copyNoneNoneWriteNoneNone
terraform-applyapply by handReadReadwrite after the copyReadNoneWriteWrite
Ruben and Ikebootstrap, restores, locksas todayAdminAdminAdmin

Scroll sideways to see every column.

Read means settings and access lists only, never images or secret values. Owner does not reach files in a bucket, so Ruben and Ike are named on each state bucket. An organisation owner applies the bootstrap and organisation folders by hand.

Folders, state and copy order

Devown state bucket
  • 1eyox-scan-dev
  • 5eyox-development
Stagingown state bucket
  • 2eyox-scan-staging
  • 6eyox-staging
Productionown state bucket
  • 3eyox-scan-production
  • 4Atlas access list
  • 7eyox-production
  • bootstrapby hand
  • organisationby hand

Copy first: one pull request per folder, imports only, zero changes, in this order. Then eyox-ml as the first new project.

Outside Terraform

Stays with other tools

Cloud Run deploys (GitHub Actions)Firebase apps and keysGitHub environmentsAtlas cluster and backupsSecret values

Never imported

What Google or a deploy createsImage versions and revisionsScheduled snapshotsDefault networks and log sinksServices being retired

Next