Fix region group CI witness and fixed-resource proof
CI runners have Python but no OpenTofu, so skip the optional tofu witness while retaining the unconditional Go size guard and required Python checks. Retained fixed-mode resources must prevent a module from proving group ownership even when its instance is absent. Check every marker and plan source, add refusal fixtures, and clarify the negative test limitations. Refresh the census for the test comments without changing runtime reads.
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
8 files changed,
+238
−15
docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md+1 −1infra/modules/region-host/tests/group_user_data.tftest.hcl+5 −0internal/provision/region_group_guards_test.go+12 −2internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv+3 −3scripts/check-region-group-plan.py+22 −8scripts/check_region_group_plan_test.py+64 −0scripts/testdata/region-group-plan/tofu-1.12-fixed-remnants-group-mode.json+130 −0
CI passed — run details
diff --git a/docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md b/docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md| index b20071370..0ae97959d 100644 |
| --- a/docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md |
| +++ b/docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md |
| @@ -22,6 +22,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the |
| - new `infra/modules/region-host/tests/group_user_data.tftest.hcl:external`: reads +file:external; written legacy, accepted-legacy, frozen |
| -Seal: `526d434888d043a8b09d8fe196f6324782d6ca20d759b080f99daa528adf6a32` → `753f734e11d51c3f1d2121489154ebd2bd5cedb3d37dda8d26f798953665e548`. |
| +Seal: `526d434888d043a8b09d8fe196f6324782d6ca20d759b080f99daa528adf6a32` → `86aa1e39a21072d17678411a4047983a756494b84a25f7719c0cdf4a61cd1b85`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/infra/modules/region-host/tests/group_user_data.tftest.hcl b/infra/modules/region-host/tests/group_user_data.tftest.hcl| index 70861caba..bf7ef1a99 100644 |
| --- a/infra/modules/region-host/tests/group_user_data.tftest.hcl |
| +++ b/infra/modules/region-host/tests/group_user_data.tftest.hcl |
| @@ -162,6 +162,9 @@ run "oversize_user_data" { |
| configuration_kms_key_arn = "arn:aws:kms:eu-west-1:640012953448:key/67c17304-3f76-4ad6-94a1-5b6e174c73cd" |
| } |
| } |
| + # OpenTofu expect_failures targets the resource, not an individual lifecycle |
| + # precondition. Both LT preconditions share this address; the queue mock above |
| + # matches the derived URL so this run exercises the size refusal. |
| expect_failures = [aws_launch_template.group] |
| } |
| @@ -171,5 +174,7 @@ run "queue_url_mismatch" { |
| target = aws_sqs_queue.terminations |
| values = { arn = "arn:aws:sqs:eu-west-1:640012953448:carlos-dev-ie-group-terminations", id = "https://sqs.eu-west-1.amazonaws.com/640012953448/another-queue" } |
| } |
| + # OpenTofu cannot select one of this resource's two preconditions. The normal |
| + # dev payload stays below the size cap so this run exercises the URL refusal. |
| expect_failures = [aws_launch_template.group] |
| } |
diff --git a/internal/provision/region_group_guards_test.go b/internal/provision/region_group_guards_test.go| index bf1e8b634..7b43b92da 100644 |
| --- a/internal/provision/region_group_guards_test.go |
| +++ b/internal/provision/region_group_guards_test.go |
| @@ -88,7 +88,14 @@ func TestRegionGroupUserDataSize(t *testing.T) { |
| } |
| module := string(groupGuardFile(t, "infra/modules/region-host/group.tf")) |
| config := groupDevConfig(t) |
| - configBlock := strings.Split(strings.Split(module, "config = { for key, value in {")[1], "} : key =>")[0] |
| + _, configStart, ok := strings.Cut(module, "config = { for key, value in {") |
| + if !ok { |
| + t.Fatalf("group config opening marker changed; update the fixture key check") |
| + } |
| + configBlock, _, ok := strings.Cut(configStart, "} : key =>") |
| + if !ok { |
| + t.Fatalf("group config closing marker changed; update the fixture key check") |
| + } |
| declared := regexp.MustCompile(`(?m)^\s*([A-Z_]+)\s*=`).FindAllStringSubmatch(configBlock, -1) |
| if len(declared) != len(config) { |
| t.Fatal("dev fixture config keys differ from the module") |
| @@ -123,7 +130,10 @@ func groupGuardBinary(t *testing.T, name string) string { |
| } |
| func TestRegionGroupUserDataOpenTofu(t *testing.T) { |
| - tofu := groupGuardBinary(t, "tofu") |
| + tofu, err := exec.LookPath("tofu") |
| + if err != nil { |
| + t.Skipf("OpenTofu witness unavailable: %v; the pure-Go TestRegionGroupUserDataSize guard still enforces the 13107 B cap in CI; run locally with tofu on PATH: go test ./internal/provision -run '^TestRegionGroupUserDataOpenTofu$' -count=1 -v", err) |
| + } |
| config := groupDevConfig(t) |
| for key, value := range config { |
| config[key] = "'" + strings.ReplaceAll(value, "'", "'\"'\"'") + "'" |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 08f1e3498..712863dfe 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -87,4 +87,4 @@ plan14-root-reads-stateless-replicas-3.tsv 703d9a189185e2075ec088bf9349e58132573 |
| 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 |
| -plan14-root-reads-region-ha-p3b1-fixes.tsv 753f734e11d51c3f1d2121489154ebd2bd5cedb3d37dda8d26f798953665e548 |
| +plan14-root-reads-region-ha-p3b1-fixes.tsv 86aa1e39a21072d17678411a4047983a756494b84a25f7719c0cdf4a61cd1b85 |
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv| index 286cb4f7c..00e45b2a4 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv |
| @@ -4,10 +4,10 @@ |
| @legacy 624bced8dc523030ba899c4b29f0828973de87776d441b16f220ee485591f70e 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;rev3=census-ruling-region-ha-p3b1-fixes;basis=Gzip the unchanged group boot render, use shared plain and encoded locals, and refuse encoded payloads above 13107 bytes. Derive the queue URL from plan-known region, partition, account and queue name, then require equality with the returned queue URL before launch. Same root boot bytes and inputs; no new runtime reads or authority. file:external@0 b94284337382ad4c94e2775998a4b6e62853ea894242906e78c6914b23918cb9 |
| @legacy 27612db189486436e3946168de5953f47e46a30e574e51aa9af60847715ae737 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;rev3=census-ruling-region-ha-p3b1-fixes;basis=Read the plain script local in boot assertions and retain the shell injection probe through the mocked partition DNS suffix, with the same queue URL bound by the launch precondition. Mock plans only; no runtime reads. file:external@0 06edbbe1f0b14f7ea8b531beac3da79b85fcae40f8d7ebbc91c5402d2605f7d7 |
| @legacy 2d4379d97336420b3a26a84cb0c6ecfc30ee822025e946ef8e1e7f51e766b7e0 infra/modules/region-host/tests/group_alarms.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add plan-only mock queue alarm defaults, thresholds, missing-data and regional notification assertions.;rev3=census-ruling-region-ha-p3b;basis=Mock group metric producers, alarm dimensions/windows/missing data and complete scoped SNS policy; retain fixed alarm expectations. Test-only Terraform input, no root runtime read.;rev3=census-ruling-region-ha-p3b1-fixes;basis=Supply the real-shape group queue URL in the group alarm mock so the launch URL equality guard is exercised. Mock plans only; no runtime reads. file:external@0 9e9fb877ee04f8ddae2b03eaac13f4da470439e4d6fa64888e9c1928931b2299 |
| -@legacy 179958636f522721ad16694de6d2d3f6572f054056da3cbb76a1a5e62d1b4d10 infra/modules/region-host/tests/group_user_data.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b1-fixes;basis=Add mock plans with the saved real dev inputs, exact gzip/templatefile equality and 13107-byte limit, plus an existing release input inflated to prove the launch precondition refuses oversize data. Test-only Terraform; no runtime reads. file:external@0 9cac548524056a417fe558b3022845b44148a6439cd627b84758858936ea2952 |
| +@legacy f91f49740b58e7689910cae84983f65cd292deb990bfb6f4ace6c7f37bdd9056 infra/modules/region-host/tests/group_user_data.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b1-fixes;basis=Add mock plans with the saved real dev inputs, exact gzip/templatefile equality and 13107-byte limit, plus an existing release input inflated to prove the launch precondition refuses oversize data. Test-only Terraform; no runtime reads. Round 1 adds comments explaining that OpenTofu expect_failures selects the launch-template resource, not either individual precondition; test behavior unchanged. file:external@0 9956291c88d6af34dfd5fb5b9c7a01596e6bac18ba7f015d2f583777ad80e890 |
| 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;rev3=census-ruling-region-ha-p3b1-fixes;basis=Gzip the unchanged group boot render, use shared plain and encoded locals, and refuse encoded payloads above 13107 bytes. Derive the queue URL from plan-known region, partition, account and queue name, then require equality with the returned queue URL before launch. Same root boot bytes and inputs; no new runtime reads or authority. file:external@0 b94284337382ad4c94e2775998a4b6e62853ea894242906e78c6914b23918cb9 |
| 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;rev3=census-ruling-region-ha-p3b1-fixes;basis=Read the plain script local in boot assertions and retain the shell injection probe through the mocked partition DNS suffix, with the same queue URL bound by the launch precondition. Mock plans only; no runtime reads. file:external@0 06edbbe1f0b14f7ea8b531beac3da79b85fcae40f8d7ebbc91c5402d2605f7d7 |
| infra/modules/region-host/tests/group_alarms.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add plan-only mock queue alarm defaults, thresholds, missing-data and regional notification assertions.;rev3=census-ruling-region-ha-p3b;basis=Mock group metric producers, alarm dimensions/windows/missing data and complete scoped SNS policy; retain fixed alarm expectations. Test-only Terraform input, no root runtime read.;rev3=census-ruling-region-ha-p3b1-fixes;basis=Supply the real-shape group queue URL in the group alarm mock so the launch URL equality guard is exercised. Mock plans only; no runtime reads. file:external@0 9e9fb877ee04f8ddae2b03eaac13f4da470439e4d6fa64888e9c1928931b2299 |
| -infra/modules/region-host/tests/group_user_data.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b1-fixes;basis=Add mock plans with the saved real dev inputs, exact gzip/templatefile equality and 13107-byte limit, plus an existing release input inflated to prove the launch precondition refuses oversize data. Test-only Terraform; no runtime reads. file:external@0 9cac548524056a417fe558b3022845b44148a6439cd627b84758858936ea2952 |
| +infra/modules/region-host/tests/group_user_data.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b1-fixes;basis=Add mock plans with the saved real dev inputs, exact gzip/templatefile equality and 13107-byte limit, plus an existing release input inflated to prove the launch precondition refuses oversize data. Test-only Terraform; no runtime reads. Round 1 adds comments explaining that OpenTofu expect_failures selects the launch-template resource, not either individual precondition; test behavior unchanged. file:external@0 9956291c88d6af34dfd5fb5b9c7a01596e6bac18ba7f015d2f583777ad80e890 |
| @coverage infra/modules/region-host e9a09976054d449e6a83e0e5643ec200a41505ea37c501ed5874d0cb9d968141 |
| -@coverage infra/modules/region-host/tests 9da05156166fe86283998817356a706d8ccda973fab327cd3b242eb0e488bf44 |
| +@coverage infra/modules/region-host/tests 182c28071adef6a9051ce634625a1114c9b831ae8e9eae8c2985de91d1661454 |
diff --git a/scripts/check-region-group-plan.py b/scripts/check-region-group-plan.py| index ef697d1b3..9b8b893f0 100755 |
| --- a/scripts/check-region-group-plan.py |
| +++ b/scripts/check-region-group-plan.py |
| @@ -21,6 +21,16 @@ RULES = {'aws_security_group_rule', 'aws_vpc_security_group_ingress_rule', |
| 'aws_vpc_security_group_egress_rule'} |
| HOST_IAM = {'aws_iam_role', 'aws_iam_instance_profile', 'aws_iam_role_policy', |
| 'aws_iam_role_policy_attachment', 'aws_iam_policy', 'aws_iam_policy_attachment'} |
| +# Fixed-only resources/data in region-host/main.tf, including those whose count |
| +# inputs the host role's group-mode precondition requires to be disabled. |
| +# Any aws_instance is also a marker, regardless of its name. |
| +FIXED_MODE_MARKERS = { |
| + ('aws_instance', 'host'), ('aws_eip', 'host'), ('aws_security_group', 'host'), |
| + ('aws_cloudwatch_metric_alarm', 'host_auto_recover'), |
| + ('aws_cloudwatch_metric_alarm', 'host_memory_low'), ('aws_ami', 'debian_arm64'), |
| + ('aws_vpcs', 'default'), ('aws_iam_role_policy', 'host_costexplorer'), |
| + ('aws_iam_policy', 'store_user_boundary'), ('aws_iam_role_policy', 'host_store'), |
| + ('aws_iam_role_policy', 'host_console_mail'), ('aws_iam_role_policy', 'host_store_scan')} |
| # OpenTofu 1.12 adds each resource's provider identity (id, ARN, account, |
| # region). It repeats values already in before and after, so the gate checks |
| # its shape and otherwise ignores it. |
| @@ -97,26 +107,30 @@ def group_module(document, prefix): |
| def group_modules(document, rows): |
| - # A group module holds no box: any aws_instance under its prefix, in any |
| - # source, leaves the whole subtree on the fixed rules. |
| + # Fixed-mode resources or data under a prefix, even without an instance, |
| + # leave the whole subtree on the fixed rules in every plan/state source. |
| found = [] |
| for row in rows: |
| if isinstance(row, dict): |
| - found.append((row.get('address'), row.get('type'))) |
| + found.append((row.get('address'), row.get('type'), row.get('name'))) |
| if 'previous_address' in row: |
| - found.append((row['previous_address'], None)) |
| + found.append((row['previous_address'], None, None)) |
| for section in ['prior_state', 'planned_values']: |
| - found += [(row.get('address'), row.get('type')) for row in state_resources(document, section)] |
| + found += [(row.get('address'), row.get('type'), row.get('name')) |
| + for row in state_resources(document, section)] |
| prefixes, boxes = set(), [] |
| - for address, kind in found: |
| + for address, kind, name in found: |
| parts = address_parts(address) |
| if parts is None: |
| - if kind == 'aws_instance' or 'aws_instance' in str(address): |
| + if (kind in {k for k, _ in FIXED_MODE_MARKERS} or |
| + any(k in str(address) for k, _ in FIXED_MODE_MARKERS)): |
| return set() |
| continue |
| prefix = module_prefix(address, parts) |
| prefixes.add(prefix) |
| - if 'aws_instance' in {kind, parts['type']}: |
| + if ('aws_instance' in {kind, parts['type']} or |
| + (kind, name) in FIXED_MODE_MARKERS or |
| + (parts['type'], parts['name']) in FIXED_MODE_MARKERS): |
| boxes.append(re.sub(INDEX, '', prefix)) |
| return {prefix for prefix in prefixes if group_module(document, prefix) and |
| not any(box.startswith(prefix) for box in boxes)} |
diff --git a/scripts/check_region_group_plan_test.py b/scripts/check_region_group_plan_test.py| index 322e4ebf7..8613e2d60 100644 |
| --- a/scripts/check_region_group_plan_test.py |
| +++ b/scripts/check_region_group_plan_test.py |
| @@ -1,4 +1,5 @@ |
| import copy |
| +import importlib.util |
| import json |
| import os |
| from pathlib import Path |
| @@ -484,6 +485,69 @@ class GroupModuleTests(unittest.TestCase): |
| provider_name='registry.opentofu.org/hashicorp/aws', schema_version=0, |
| values={'id': 'i-0hidden1'}, sensitive_values={}) |
| + def test_fixed_remnants_refuse_group_mode_iam_update(self): |
| + document = self.fixture('tofu-1.12-fixed-remnants-group-mode.json') |
| + self.assertIn('fixed box resources cannot be changed', self.gate(document, 1).stderr) |
| + for section in ['prior_state', 'planned_values']: |
| + state_children(document, section)[0]['resources'] = [] |
| + self.gate(document, 0) |
| + |
| + def test_group_with_fixed_remnants_refuses_sg_and_eip_changes(self): |
| + original = self.fixture('tofu-1.12-fixed-remnants-group-mode.json') |
| + document = json.loads(json.dumps(original).replace('host_ie', 'host_ie_group')) |
| + rows = {row['type']: row for row in state_children(document, 'prior_state')[0]['resources']} |
| + for kind, after, actions in [ |
| + ('aws_security_group', {'id': 'sg-fixed', 'ingress': [{'cidr_blocks': ['0.0.0.0/0']}]}, ['update']), |
| + ('aws_security_group', None, ['delete']), |
| + ('aws_eip', {'id': 'eipalloc-fixed', 'instance': 'i-other'}, ['update'])]: |
| + with self.subTest(kind=kind, actions=actions): |
| + row = rows[kind] |
| + bad = copy.deepcopy(document) |
| + bad['resource_changes'] = [resource(row['address'], kind, row['name'], |
| + row['values'], after, actions=actions)] |
| + self.assertIn('fixed box resources cannot be changed', self.gate(bad, 1).stderr) |
| + |
| + def test_fixed_mode_markers_in_every_source(self): |
| + spec = importlib.util.spec_from_file_location('region_group_gate', GATE) |
| + gate = importlib.util.module_from_spec(spec) |
| + spec.loader.exec_module(gate) |
| + markers = [('aws_instance', 'host'), ('aws_eip', 'host'), ('aws_security_group', 'host'), |
| + ('aws_cloudwatch_metric_alarm', 'host_auto_recover'), |
| + ('aws_cloudwatch_metric_alarm', 'host_memory_low'), ('aws_ami', 'debian_arm64'), |
| + ('aws_vpcs', 'default'), ('aws_iam_role_policy', 'host_costexplorer'), |
| + ('aws_iam_policy', 'store_user_boundary'), ('aws_iam_role_policy', 'host_store'), |
| + ('aws_iam_role_policy', 'host_console_mail'), ('aws_iam_role_policy', 'host_store_scan')] |
| + for kind, name in markers: |
| + for source in ['prior_state', 'planned_values', 'before', 'after', 'drift', |
| + 'previous_address', 'drift_previous_address']: |
| + with self.subTest(kind=kind, name=name, source=source): |
| + document = self.fixture('tofu-1.12-fixed-remnants-group-mode.json') |
| + for section in ['prior_state', 'planned_values']: |
| + state_children(document, section)[0]['resources'] = [] |
| + data = 'data.' if kind in {'aws_ami', 'aws_vpcs'} else '' |
| + address = FIXED_MODULE + f'{data}{kind}.{name}[0]' |
| + values = {'id': 'fixed-marker'} |
| + row = resource(address, kind, name, values, values, actions=['no-op']) |
| + row['mode'] = 'data' if data else 'managed' |
| + if source in ['prior_state', 'planned_values']: |
| + state_children(document, source)[0]['resources'] = [dict( |
| + address=address, mode=row['mode'], type=kind, name=name, values=values)] |
| + else: |
| + if source in ['previous_address', 'drift_previous_address']: |
| + row['previous_address'] = address |
| + row['address'] = f'module.elsewhere.{data}{kind}.{name}[0]' |
| + elif source == 'before': |
| + row['change'].update(after=None, actions=['delete']) |
| + elif source == 'after': |
| + row['change'].update(before=None, actions=['read' if data else 'create']) |
| + if source in ['drift', 'drift_previous_address']: |
| + document['resource_drift'] = [row] |
| + else: |
| + document['resource_changes'].append(row) |
| + # Check the proof directly as move guards can also refuse these plans. |
| + self.assertNotIn(FIXED_MODULE, gate.group_modules(document, gate.changes(document))) |
| + self.assertIn('fixed box resources cannot be changed', self.gate(document, 1).stderr) |
| + |
| def test_partial_apply_cleanup_with_and_without_manifest(self): |
| # The 2026-11-04 dev rollback: 18 group resources, targeted destroy. |
| document = self.fixture('tofu-1.12-group-partial-destroy.json') |
diff --git a/scripts/testdata/region-group-plan/tofu-1.12-fixed-remnants-group-mode.json b/scripts/testdata/region-group-plan/tofu-1.12-fixed-remnants-group-mode.json| new file mode 100644 |
| index 000000000..b7b75ff6d |
| --- /dev/null |
| +++ b/scripts/testdata/region-group-plan/tofu-1.12-fixed-remnants-group-mode.json |
| @@ -0,0 +1,130 @@ |
| +{ |
| + "format_version": "1.2", |
| + "terraform_version": "1.12.5", |
| + "configuration": { |
| + "root_module": { |
| + "module_calls": { |
| + "host_ie": { |
| + "source": "./modules/region-host", |
| + "expressions": { |
| + "mode": { |
| + "constant_value": "group" |
| + } |
| + }, |
| + "module": { |
| + "resources": [] |
| + } |
| + } |
| + } |
| + } |
| + }, |
| + "prior_state": { |
| + "values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "mode": "managed", |
| + "type": "aws_eip", |
| + "name": "host", |
| + "index": 0, |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "values": { |
| + "id": "eipalloc-fixed", |
| + "instance": "i-previous" |
| + }, |
| + "sensitive_values": {} |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "mode": "managed", |
| + "type": "aws_security_group", |
| + "name": "host", |
| + "index": 0, |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "values": { |
| + "id": "sg-fixed", |
| + "ingress": [] |
| + }, |
| + "sensitive_values": {} |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + } |
| + }, |
| + "planned_values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "mode": "managed", |
| + "type": "aws_eip", |
| + "name": "host", |
| + "index": 0, |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "values": { |
| + "id": "eipalloc-fixed", |
| + "instance": "i-previous" |
| + }, |
| + "sensitive_values": {} |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "mode": "managed", |
| + "type": "aws_security_group", |
| + "name": "host", |
| + "index": 0, |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "values": { |
| + "id": "sg-fixed", |
| + "ingress": [] |
| + }, |
| + "sensitive_values": {} |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + }, |
| + "resource_changes": [ |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "mode": "managed", |
| + "type": "aws_iam_role", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "change": { |
| + "actions": [ |
| + "update" |
| + ], |
| + "before": { |
| + "name": "fixed-role", |
| + "description": "before" |
| + }, |
| + "after": { |
| + "name": "fixed-role", |
| + "description": "after" |
| + }, |
| + "after_unknown": {}, |
| + "before_identity": { |
| + "name": "fixed-role" |
| + }, |
| + "after_identity": { |
| + "name": "fixed-role" |
| + } |
| + } |
| + } |
| + ] |
| +} |