No-AWS sandbox for the shared Terraform workflows in
acme-iacplatform-githubworkflows.
It stands in for a foundation deploy repo: engorg/ and prodorg/ are environment
directories with a null_resource and a local backend.
One stub per env, .github/workflows/deploy-<env>.yml, calling the shared
terraform-deploy.yml in one job: plan on PR, apply on push to main, and
workflow_dispatch (plan/apply, apply on main only). With no AWS account
passed, the job skips AWS credentials and runs against the local backend.
The stubs keep the template's path filter on push but not on pull_request:
every PR plans every env, so each env's check (deploy / Deploy <env>) can be
required. A path-filtered check that never runs would block the PR.
As in the template, the job binds environment: <env> on every run, so a PR
plan for prodorg waits for its required reviewer, and the environments allow
all branches.
| file | terraform | purpose |
|---|---|---|
engorg/mise.toml |
1.13.5 | Full tool set: terraform, tflint, trivy, min_version, [_] CONFIG_SKIP. |
prodorg/mise.toml |
1.14.2 | Same, deliberately a different Terraform. |
The root mise.toml holds only the config tasks. Every tool pin lives in the
env directory, so scanner upgrades roll engorg → prodorg the same way
Terraform does. The cost is that engorg and prodorg can drift for tools other
than Terraform, which is deliberate.
Without a root config, a job that forgets mise-action's working_directory
installs nothing:
- On
ubuntu-24.04,terraformis not found. That's loud. - On
ubuntu-22.04(preinstalls Terraform 1.16.3) or a self-hosted runner with Terraform installed, the runner's version runs silently. - On a self-hosted runner with a persistent mise data dir, shims left over from earlier jobs decide what runs.
The shared setup-tools verify step (mise's version vs the one on PATH)
fails all of these. Keep it, and keep runs-on pinned.
Vendored configs in each env dir (.tflint.hcl, trivy.yaml, .trivyignore,
.checkov.yml, .terraform-docs.yml) must match the shared repo at the SHA that env's stubs pin.
mise run config:sync engorg # vendor configs at the SHA deploy-engorg.yml pins
mise run config:check engorg # what CI checksThe tasks live in the root mise.toml. Each one runs config_sync.py from the
shared repo, which takes the configs at the SHA the env's stub pins. To upgrade
an env, change its stub's uses: SHA and version comment, then run
config:sync for it. Upgrade engorg first, then prodorg.
Listing a file in CONFIG_SKIP (under [_] in the env's mise.toml) makes
the env's copy the one CI uses, unchecked against the shared repo. That can
weaken scanning without anyone noticing:
- trivy's
severityis an exact list, not a threshold. ReplacingHIGHwithMEDIUMstops HIGH findings being reported at all. A localtrivy.yamlmust keepHIGHandCRITICALand add levels, never swap them. .trivyignoreentries need a reason and an expiry, as its header says.
CODEOWNERS gives the platform team every env's mise.toml and scanner
configs, so owning or editing one needs their review. It only takes effect
with branch protection on main requiring code owner review.
- Shared repo access. The shared repo and this repo are public, so any repo can call the shared workflows. If the shared repo goes private, set Settings → Actions → General → Access to "Accessible from repositories in the organization"; that only covers private callers.
- GitHub App with Contents: read, installed on all repositories in
the org. Tokens carry no
repositories:list, so the installation scope is what they can read: the shared repo and every private module repo. Reusable workflows check themselves out atjob.workflow_sha, and a caller'sGITHUB_TOKENcan't read another private repo. In this repo, set the variableGITHUBMCH_REPOS_READ_APP_CLIENT_ID(an org variable at the client) and the secretGITHUBMCH_REPOS_READ_APP_PRIVATE_KEY. - Environments
engorgandprodorg, open to all branches (PR plans bind them too), with a required reviewer onprodorg. On GitHub Team, required reviewers work only in public repos, which is why this repo is public. "Require main for apply" in the shared workflow stops applies from other branches. - Push the shared repo, pin each env's stub to it, then
mise run config:sync <env>. - Optional: protect
mainwith required code owner review, to test CODEOWNERS. - Later, with a bootstrapped account: pass
aws-account-idin the stubs. While it's empty, the workflow skips AWS credentials.
The probe workflows used to validate this setup (OIDC claims, environments,
reusable-workflow interface, secret masking, mise resolution) were removed
after testing. They are in git history at f399c47 here and 641caa8 in the
shared repo.