region-host group: fall back to the VPC's main route table
Region HA P3b-1 card item 1. Default-VPC subnets have no explicit route table association, so the group plan failed with 'no matching Route Table found'. Take an explicit association first, else the VPC's main table. Two mock tofu runs; census region-ha-group-rtb approved by Astra on #280. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from region-ha-group-rtb-fix into main.
5 files changed,
+86
−3
docs/superpowers/notes/census-proposal-region-ha-group-rtb.md+21 −0infra/modules/region-host/group.tf+22 −3infra/modules/region-host/tests/group.tftest.hcl+34 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-region-ha-group-rtb.tsv+8 −0
CI passed — run details
diff --git a/docs/superpowers/notes/census-proposal-region-ha-group-rtb.md b/docs/superpowers/notes/census-proposal-region-ha-group-rtb.md| new file mode 100644 |
| index 000000000..979a2fed3 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-region-ha-group-rtb.md |
| @@ -0,0 +1,21 @@ |
| +# Census approval: region-ha-group-rtb |
| + |
| +Ruling `census-ruling-region-ha-group-rtb`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `infra/modules/region-host/group.tf` `external` | body | unchanged (1) | The group route-table lookup finds an explicit subnet association first (aws_route_tables) and falls back to the VPC main table (association.main=true); same AWS describe reads, operator Terraform only, no root runtime read | |
| +| `infra/modules/region-host/tests/group.tftest.hcl` `external` | body | unchanged (1) | Two mock runs: implicit main route table, explicit association wins; test-only Terraform | |
| + |
| +Envelopes re-pinned: `infra/modules/region-host`, `infra/modules/region-host/tests`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `infra/modules/region-host/group.tf` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Add opt-in pinned AMI/template ASG, group security group, validated reused/new ingress, fixed capacity and ABANDON launch hook; suspend AZRebalance, no refresh policy. Operator Terraform writes scoped queue and boot/ingress SSM parameters (stable array of ingress IPv4s) before launches; root boot snapshots these inputs. Explicit moves preserve fixed resource addresses. |
| +- `infra/modules/region-host/tests/group.tftest.hcl` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Add mock plans covering group shape, network/AMI checks, launch constraints, boot config/ingress parameters and default fixed absence. Test-only Terraform, no real AWS effects or root runtime reads. |
| + |
| +Seal: `face84b4c688cd3c179b0a34ced4d3521e71de8e63cbd45f21c27972c5b1a921` → `526d434888d043a8b09d8fe196f6324782d6ca20d759b080f99daa528adf6a32`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-group-rtb.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/infra/modules/region-host/group.tf b/infra/modules/region-host/group.tf| index d56876b17..a40a4efa9 100644 |
| --- a/infra/modules/region-host/group.tf |
| +++ b/infra/modules/region-host/group.tf |
| @@ -58,10 +58,29 @@ data "aws_subnets" "group" { |
| } |
| } |
| +# A subnet with no explicit route table association (every default-VPC |
| +# subnet) uses the VPC's main table, which a subnet-id lookup never finds. |
| +data "aws_route_tables" "group_explicit" { |
| + for_each = local.group_enabled ? var.group_zones : {} |
| + vpc_id = var.vpc_id |
| + filter { |
| + name = "association.subnet-id" |
| + values = [each.value.subnet_id] |
| + } |
| +} |
| + |
| +data "aws_route_table" "group_main" { |
| + count = local.group_enabled ? 1 : 0 |
| + vpc_id = var.vpc_id |
| + filter { |
| + name = "association.main" |
| + values = ["true"] |
| + } |
| +} |
| + |
| data "aws_route_table" "group" { |
| - for_each = local.group_enabled ? var.group_zones : {} |
| - subnet_id = each.value.subnet_id |
| - vpc_id = var.vpc_id |
| + for_each = local.group_enabled ? var.group_zones : {} |
| + route_table_id = length(data.aws_route_tables.group_explicit[each.key].ids) > 0 ? data.aws_route_tables.group_explicit[each.key].ids[0] : data.aws_route_table.group_main[0].id |
| } |
| data "aws_lb" "group" { |
diff --git a/infra/modules/region-host/tests/group.tftest.hcl b/infra/modules/region-host/tests/group.tftest.hcl| index 43dfb0936..d8cbe0076 100644 |
| --- a/infra/modules/region-host/tests/group.tftest.hcl |
| +++ b/infra/modules/region-host/tests/group.tftest.hcl |
| @@ -359,6 +359,40 @@ run "private_subnets" { |
| } |
| expect_failures = [aws_security_group.group] |
| } |
| +run "implicit_main_route_table" { |
| + command = plan |
| + override_data { |
| + target = data.aws_route_tables.group_explicit |
| + values = { ids = [] } |
| + } |
| + override_data { |
| + target = data.aws_route_table.group_main |
| + values = { id = "rtb-0000000000000main" } |
| + } |
| + assert { |
| + condition = alltrue([for table in data.aws_route_table.group : table.route_table_id == "rtb-0000000000000main"]) |
| + error_message = "a subnet with no explicit association must use the VPC's main route table" |
| + } |
| +} |
| +run "explicit_route_table" { |
| + command = plan |
| + override_data { |
| + target = data.aws_route_tables.group_explicit["eu-west-1a"] |
| + values = { ids = ["rtb-00000000000000001"] } |
| + } |
| + override_data { |
| + target = data.aws_route_tables.group_explicit["eu-west-1b"] |
| + values = { ids = [] } |
| + } |
| + override_data { |
| + target = data.aws_route_table.group_main |
| + values = { id = "rtb-0000000000000main" } |
| + } |
| + assert { |
| + condition = data.aws_route_table.group["eu-west-1a"].route_table_id == "rtb-00000000000000001" && data.aws_route_table.group["eu-west-1b"].route_table_id == "rtb-0000000000000main" |
| + error_message = "an explicit subnet association wins over the main route table" |
| + } |
| +} |
| run "wrong_vpc_target_group" { |
| command = plan |
| override_data { |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index cad8720f0..d9cc40bbc 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -86,3 +86,4 @@ plan14-root-reads-region-ha-p2b.tsv 59c0891618b9befae27ebe04d0a67b08c7f7658bca9f |
| plan14-root-reads-stateless-replicas-3.tsv 703d9a189185e2075ec088bf9349e5813257308c67187b5968680ea4f9635af1 |
| plan14-root-reads-region-ha-p3b.tsv face84b4c688cd3c179b0a34ced4d3521e71de8e63cbd45f21c27972c5b1a921 |
| plan14-root-reads-stateless-coordinator-oneboxfleet.tsv face84b4c688cd3c179b0a34ced4d3521e71de8e63cbd45f21c27972c5b1a921 |
| +plan14-root-reads-region-ha-group-rtb.tsv 526d434888d043a8b09d8fe196f6324782d6ca20d759b080f99daa528adf6a32 |
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-group-rtb.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-group-rtb.tsv| new file mode 100644 |
| index 000000000..2d16fb6a1 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-region-ha-group-rtb.tsv |
| @@ -0,0 +1,8 @@ |
| +# Census overlay region-ha-group-rtb, written by census-propose (#369). census-ruling-region-ha-group-rtb, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-region-ha-group-rtb.md. |
| +# 2 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy 7f41eb0ffb06f60b3d0dffa59a339ed790d573708cb1dc1aad1882b284a2a3e8 infra/modules/region-host/group.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Add opt-in pinned AMI/template ASG, group security group, validated reused/new ingress, fixed capacity and ABANDON launch hook; suspend AZRebalance, no refresh policy. Operator Terraform writes scoped queue and boot/ingress SSM parameters (stable array of ingress IPv4s) before launches; root boot snapshots these inputs. Explicit moves preserve fixed resource addresses.;rev3=census-ruling-region-ha-group-rtb;basis=The group route-table lookup finds an explicit subnet association first (aws_route_tables) and falls back to the VPC main table (association.main=true); same AWS describe reads, operator Terraform only, no root runtime read file:external@0 2398e823d0112a28a5091e78f2a1d5b7e2cf194d975f06fe3297c7dcc8c2f359 |
| +@legacy 4225670e65ac6b71392036fc872d2ed9146a2f3447733a6291f8948c4016f155 infra/modules/region-host/tests/group.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Add mock plans covering group shape, network/AMI checks, launch constraints, boot config/ingress parameters and default fixed absence. Test-only Terraform, no real AWS effects or root runtime reads.;rev3=census-ruling-region-ha-group-rtb;basis=Two mock runs: implicit main route table, explicit association wins; test-only Terraform file:external@0 b8b7e1a7d6a901b53d18c0f6e845f837f48aeeb31e1b05ecf19c5272c2aae27c |
| +infra/modules/region-host/group.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Add opt-in pinned AMI/template ASG, group security group, validated reused/new ingress, fixed capacity and ABANDON launch hook; suspend AZRebalance, no refresh policy. Operator Terraform writes scoped queue and boot/ingress SSM parameters (stable array of ingress IPv4s) before launches; root boot snapshots these inputs. Explicit moves preserve fixed resource addresses.;rev3=census-ruling-region-ha-group-rtb;basis=The group route-table lookup finds an explicit subnet association first (aws_route_tables) and falls back to the VPC main table (association.main=true); same AWS describe reads, operator Terraform only, no root runtime read file:external@0 2398e823d0112a28a5091e78f2a1d5b7e2cf194d975f06fe3297c7dcc8c2f359 |
| +infra/modules/region-host/tests/group.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Add mock plans covering group shape, network/AMI checks, launch constraints, boot config/ingress parameters and default fixed absence. Test-only Terraform, no real AWS effects or root runtime reads.;rev3=census-ruling-region-ha-group-rtb;basis=Two mock runs: implicit main route table, explicit association wins; test-only Terraform file:external@0 b8b7e1a7d6a901b53d18c0f6e845f837f48aeeb31e1b05ecf19c5272c2aae27c |
| +@coverage infra/modules/region-host 22a952706e52c030c2a091de694e5598289201d0b3772ee4804f360646ae6070 |
| +@coverage infra/modules/region-host/tests e2324fb76abb16d91607e62c94d0db29264ca11dd644c45712f165fdb342fe70 |