infra: OpenTofu for the hosted stack, dev and prod
Modules account, network, config, controller, proxy and alerts; roots
envs/prod/{account,network,config,services} and envs/dev/{network,
config,services}, each with one provider pinned by allowed_account_ids
and eu-west-1, and mocked-provider tests. plan-check.py refuses a plan
that phases.json does not allow: unlisted addresses, any action but
create (delete or no-op for destroy phases), foreign ARNs, provider
aliases, provisioners, terraform_data, null_resource, and unknown pinned
values that are not references to resources the plan creates. Tested
on fresh-plan fixtures of envs/prod/network. make hosted-infra-check
and the 16-hosted-infra CI lane run it all, tofu 1.12.5 pinned in the
CI box.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
50 files changed,
+16,742
−2
.amadan/ci.d/16-hosted-infra+6 −0Makefile+26 −2docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md+22 −0infra/hosted/.gitignore+4 −0infra/hosted/README.md+109 −0infra/hosted/envs/dev/config/.terraform.lock.hcl+39 −0infra/hosted/envs/dev/config/main.tf+126 −0infra/hosted/envs/dev/config/tests/config.tftest.hcl+37 −0infra/hosted/envs/dev/network/.terraform.lock.hcl+39 −0infra/hosted/envs/dev/network/main.tf+136 −0infra/hosted/envs/dev/network/tests/network.tftest.hcl+56 −0infra/hosted/envs/dev/services/.terraform.lock.hcl+39 −0infra/hosted/envs/dev/services/main.tf+156 −0infra/hosted/envs/dev/services/tests/services.tftest.hcl+59 −0infra/hosted/envs/prod/account/.terraform.lock.hcl+39 −0infra/hosted/envs/prod/account/main.tf+64 −0infra/hosted/envs/prod/account/tests/account.tftest.hcl+139 −0infra/hosted/envs/prod/config/.terraform.lock.hcl+39 −0infra/hosted/envs/prod/config/main.tf+63 −0infra/hosted/envs/prod/config/tests/iam.tftest.hcl+122 −0infra/hosted/envs/prod/network/.terraform.lock.hcl+39 −0infra/hosted/envs/prod/network/main.tf+136 −0infra/hosted/envs/prod/network/tests/network.tftest.hcl+188 −0infra/hosted/envs/prod/services/.terraform.lock.hcl+39 −0infra/hosted/envs/prod/services/main.tf+156 −0infra/hosted/envs/prod/services/tests/alerts.tftest.hcl+56 −0infra/hosted/envs/prod/services/tests/iam.tftest.hcl+286 −0infra/hosted/modules/account/main.tf+206 −0infra/hosted/modules/account/outputs.tf+11 −0infra/hosted/modules/account/variables.tf+41 −0infra/hosted/modules/alerts/main.tf+125 −0infra/hosted/modules/alerts/variables.tf+25 −0infra/hosted/modules/config/main.tf+262 −0infra/hosted/modules/config/outputs.tf+23 −0infra/hosted/modules/config/variables.tf+27 −0infra/hosted/modules/controller/main.tf+247 −0infra/hosted/modules/controller/outputs.tf+11 −0infra/hosted/modules/controller/variables.tf+70 −0infra/hosted/modules/network/main.tf+315 −0infra/hosted/modules/network/outputs.tf+34 −0infra/hosted/modules/network/variables.tf+80 −0infra/hosted/modules/proxy/main.tf+150 −0infra/hosted/modules/proxy/outputs.tf+15 −0infra/hosted/modules/proxy/variables.tf+66 −0infra/hosted/scripts/phases.json+4,731 −0infra/hosted/scripts/plan-check.py+607 −0infra/hosted/scripts/plan_check_test.py+621 −0infra/hosted/scripts/testdata/network-destroy-plan.json+3,477 −0infra/hosted/scripts/testdata/network-plan.json+3,360 −0scripts/ci-box.json+18 −0
.amadan/ci.d/16-hosted-infraLoading diff…
MakefileLoading diff…
docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.mdLoading diff…
infra/hosted/.gitignoreLoading diff…
infra/hosted/README.mdLoading diff…
infra/hosted/envs/dev/config/.terraform.lock.hclLoading diff…
infra/hosted/envs/dev/config/main.tfLoading diff…
infra/hosted/envs/dev/config/tests/config.tftest.hclLoading diff…
infra/hosted/envs/dev/network/.terraform.lock.hclLoading diff…
infra/hosted/envs/dev/network/main.tfLoading diff…
infra/hosted/envs/dev/network/tests/network.tftest.hclLoading diff…
infra/hosted/envs/dev/services/.terraform.lock.hclLoading diff…
infra/hosted/envs/dev/services/main.tfLoading diff…
infra/hosted/envs/dev/services/tests/services.tftest.hclLoading diff…
infra/hosted/envs/prod/account/.terraform.lock.hclLoading diff…
infra/hosted/envs/prod/account/main.tfLoading diff…
infra/hosted/envs/prod/account/tests/account.tftest.hclLoading diff…
infra/hosted/envs/prod/config/.terraform.lock.hclLoading diff…
infra/hosted/envs/prod/config/main.tfLoading diff…
infra/hosted/envs/prod/config/tests/iam.tftest.hclLoading diff…
infra/hosted/envs/prod/network/.terraform.lock.hclLoading diff…
infra/hosted/envs/prod/network/main.tfLoading diff…
infra/hosted/envs/prod/network/tests/network.tftest.hclLoading diff…
infra/hosted/envs/prod/services/.terraform.lock.hclLoading diff…
infra/hosted/envs/prod/services/main.tfLoading diff…
infra/hosted/envs/prod/services/tests/alerts.tftest.hclLoading diff…
infra/hosted/envs/prod/services/tests/iam.tftest.hclLoading diff…
infra/hosted/modules/account/main.tfLoading diff…
infra/hosted/modules/account/outputs.tfLoading diff…
infra/hosted/modules/account/variables.tfLoading diff…
infra/hosted/modules/alerts/main.tfLoading diff…
infra/hosted/modules/alerts/variables.tfLoading diff…
infra/hosted/modules/config/main.tfLoading diff…
infra/hosted/modules/config/outputs.tfLoading diff…
infra/hosted/modules/config/variables.tfLoading diff…
infra/hosted/modules/controller/main.tfLoading diff…
infra/hosted/modules/controller/outputs.tfLoading diff…
infra/hosted/modules/controller/variables.tfLoading diff…
infra/hosted/modules/network/main.tfLoading diff…
infra/hosted/modules/network/outputs.tfLoading diff…
infra/hosted/modules/network/variables.tfLoading diff…
infra/hosted/modules/proxy/main.tfLoading diff…
infra/hosted/modules/proxy/outputs.tfLoading diff…
infra/hosted/modules/proxy/variables.tfLoading diff…
infra/hosted/scripts/phases.jsonLoading diff…
infra/hosted/scripts/plan-check.pyLoading diff…
infra/hosted/scripts/plan_check_test.pyLoading diff…
infra/hosted/scripts/testdata/network-destroy-plan.jsonLoading diff…
infra/hosted/scripts/testdata/network-plan.jsonLoading diff…
scripts/ci-box.jsonLoading diff…