carlos / platform Public

region plan gate: accept OpenTofu 1.12 identity fields

OpenTofu 1.12.5 adds before_identity/after_identity to every resource
change, so the P3a gate refused every real plan. Accept both keys when
null or an object, otherwise ignore them; all existing refusals hold.
Fixtures from a real 1.12.5 saved plan plus a test that a fixed change
carrying identity is still refused. Opus review: approve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from fix-gate-after-identity into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 38cda89e2b888a33859cb60f7941b5e1b7194bb9 parent 7920ccc
4 files changed, +1,119 −2
  • scripts/check-region-group-plan.py +7 −2
  • scripts/check_region_group_plan_test.py +23 −0
  • scripts/testdata/region-group-plan/tofu-1.12-fixed-replace.json +681 −0
  • scripts/testdata/region-group-plan/tofu-1.12-identity.json +408 −0

CI passed — run details

diff --git a/scripts/check-region-group-plan.py b/scripts/check-region-group-plan.py
index c375dccd5..d80b93732 100755
--- a/scripts/check-region-group-plan.py
+++ b/scripts/check-region-group-plan.py
@@ -21,8 +21,12 @@ 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'}
+# 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.
+IDENTITY_FIELDS = {'before_identity', 'after_identity'}
CHANGE_FIELDS = {'actions', 'before', 'after', 'after_unknown', 'before_sensitive',
- 'after_sensitive', 'replace_paths', 'importing', 'generated_config'}
+ 'after_sensitive', 'replace_paths', 'importing', 'generated_config'} | IDENTITY_FIELDS
ACTIONS = [['no-op'], ['create'], ['read'], ['update'], ['delete'],
['delete', 'create'], ['create', 'delete']]
DISPOSABLE = {('aws_eip', 'public'), ('aws_lb', 'nlb'), ('aws_security_group', 'nlb'),
@@ -96,7 +100,8 @@ def parse_resource(row):
not isinstance(change['after_unknown'], (dict, bool)) or
change['actions'] not in ACTIONS or
any(value is not None and not isinstance(value, dict)
- for value in (change['before'], change['after'])) or
+ for value in [change['before'], change['after']] +
+ [change.get(key) for key in IDENTITY_FIELDS]) or
change.get('importing') is not None or change.get('generated_config') is not None):
raise Refused(UNKNOWN % address)
actions, before, after = change['actions'], change['before'], change['after']
diff --git a/scripts/check_region_group_plan_test.py b/scripts/check_region_group_plan_test.py
index 526d204a8..acf970b49 100644
--- a/scripts/check_region_group_plan_test.py
+++ b/scripts/check_region_group_plan_test.py
@@ -180,6 +180,29 @@ class GateTests(unittest.TestCase):
document = json.loads((GATE.parent / 'testdata/region-group-plan' / name).read_text())
self.gate(document, expected)
+ def test_tofu_1_12_identity_fields(self):
+ # Both fixtures come from a real OpenTofu 1.12.5 saved plan (fake account and ids).
+ self.gate(self.fixture('tofu-1.12-identity.json'), 0)
+ replace = self.fixture('tofu-1.12-fixed-replace.json')
+ refused = self.gate(replace, 1).stderr
+ self.assertIn('aws_instance.host', refused)
+ for row in replace['resource_changes']:
+ for key in ['before_identity', 'after_identity']:
+ row['change'].pop(key, None)
+ self.assertEqual(refused, self.gate(replace, 1).stderr)
+ identity = {'account_id': '123456789012', 'id': 'i-fixed', 'region': 'eu-west-1'}
+ update = resource(before={'id': 'i-fixed', 'user_data': 'old'},
+ after={'id': 'i-fixed', 'user_data': 'new'})
+ update['change'].update(before_identity=identity, after_identity=identity)
+ result = self.gate(plan(update), 1)
+ self.assertIn('fixed box resources cannot be changed', result.stderr)
+ for value in ['i-fixed', ['i-fixed'], True]:
+ with self.subTest(identity=value):
+ noop = resource(before={'id': 'i-fixed'}, after={'id': 'i-fixed'},
+ actions=['no-op'])
+ noop['change']['after_identity'] = value
+ self.gate(plan(noop), 1)
+
def test_fixed_updates_and_targeted_closure(self):
for attr in ['user_data', 'instance_type', 'iam_instance_profile', 'root_block_device']:
with self.subTest(attr=attr):
diff --git a/scripts/testdata/region-group-plan/tofu-1.12-fixed-replace.json b/scripts/testdata/region-group-plan/tofu-1.12-fixed-replace.json
new file mode 100644
index 000000000..a043a89fa
--- /dev/null
+++ b/scripts/testdata/region-group-plan/tofu-1.12-fixed-replace.json
@@ -0,0 +1,681 @@
+{
+ "format_version": "1.2",
+ "terraform_version": "1.12.5",
+ "planned_values": {
+ "root_module": {
+ "resources": [
+ {
+ "address": "aws_eip.public",
+ "mode": "managed",
+ "type": "aws_eip",
+ "name": "public",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 0,
+ "values": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "sensitive_values": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ },
+ "identity_schema_version": 0
+ },
+ {
+ "address": "aws_instance.host",
+ "mode": "managed",
+ "type": "aws_instance",
+ "name": "host",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 2,
+ "values": {
+ "ami": "ami-0abc",
+ "credit_specification": [],
+ "force_destroy": false,
+ "get_password_data": false,
+ "hibernation": null,
+ "instance_type": "t4g.micro",
+ "launch_template": [],
+ "region": "eu-west-1",
+ "source_dest_check": true,
+ "tags": {
+ "Name": "box"
+ },
+ "tags_all": {
+ "Name": "box"
+ },
+ "timeouts": null,
+ "user_data": null,
+ "user_data_replace_on_change": false,
+ "volume_tags": null
+ },
+ "sensitive_values": {
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "ebs_block_device": [],
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "instance_market_options": [],
+ "ipv6_addresses": [],
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "network_interface": [],
+ "primary_network_interface": [],
+ "private_dns_name_options": [],
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "secondary_private_ips": [],
+ "security_groups": [],
+ "tags": {},
+ "tags_all": {},
+ "vpc_security_group_ids": []
+ },
+ "identity": {
+ "account_id": null,
+ "id": null,
+ "region": null
+ },
+ "identity_schema_version": 0
+ },
+ {
+ "address": "aws_lb_target_group.target",
+ "mode": "managed",
+ "type": "aws_lb_target_group",
+ "name": "target",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 0,
+ "values": {
+ "deregistration_delay": "300",
+ "lambda_multi_value_headers_enabled": false,
+ "name": "t80",
+ "port": 80,
+ "protocol": "TCP",
+ "proxy_protocol_v2": false,
+ "region": "eu-west-1",
+ "slow_start": 0,
+ "tags": null,
+ "target_control_port": null,
+ "target_type": "instance",
+ "vpc_id": "vpc-0abc"
+ },
+ "sensitive_values": {
+ "health_check": [],
+ "load_balancer_arns": [],
+ "stickiness": [],
+ "tags_all": {},
+ "target_failover": [],
+ "target_group_health": [],
+ "target_health_state": []
+ },
+ "identity": {
+ "arn": null
+ },
+ "identity_schema_version": 0
+ }
+ ]
+ }
+ },
+ "resource_changes": [
+ {
+ "address": "aws_eip.public",
+ "mode": "managed",
+ "type": "aws_eip",
+ "name": "public",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "change": {
+ "actions": [
+ "no-op"
+ ],
+ "before": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "after": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "after_unknown": {},
+ "before_sensitive": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "after_sensitive": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "before_identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ },
+ "after_identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ }
+ }
+ },
+ {
+ "address": "aws_instance.host",
+ "mode": "managed",
+ "type": "aws_instance",
+ "name": "host",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "change": {
+ "actions": [
+ "delete",
+ "create"
+ ],
+ "before": {
+ "ami": "ami-0abc",
+ "arn": null,
+ "associate_public_ip_address": null,
+ "availability_zone": null,
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "disable_api_stop": null,
+ "disable_api_termination": null,
+ "ebs_block_device": [],
+ "ebs_optimized": null,
+ "enable_primary_ipv6": null,
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "force_destroy": null,
+ "get_password_data": null,
+ "hibernation": null,
+ "host_id": null,
+ "host_resource_group_arn": null,
+ "iam_instance_profile": null,
+ "id": "i-0fixed1",
+ "instance_initiated_shutdown_behavior": null,
+ "instance_lifecycle": null,
+ "instance_market_options": [],
+ "instance_state": null,
+ "instance_type": "t4g.micro",
+ "ipv6_address_count": null,
+ "ipv6_addresses": null,
+ "key_name": null,
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "monitoring": null,
+ "network_interface": [],
+ "outpost_arn": null,
+ "password_data": null,
+ "placement_group": null,
+ "placement_group_id": null,
+ "placement_partition_number": null,
+ "primary_network_interface": [],
+ "primary_network_interface_id": "eni-0fixed1",
+ "private_dns": null,
+ "private_dns_name_options": [],
+ "private_ip": null,
+ "public_dns": null,
+ "public_ip": null,
+ "region": "eu-west-1",
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "secondary_private_ips": null,
+ "security_groups": null,
+ "source_dest_check": null,
+ "spot_instance_request_id": null,
+ "subnet_id": null,
+ "tags": {
+ "Name": "box"
+ },
+ "tags_all": {
+ "Name": "box"
+ },
+ "tenancy": null,
+ "timeouts": null,
+ "user_data": null,
+ "user_data_base64": null,
+ "user_data_replace_on_change": null,
+ "volume_tags": null,
+ "vpc_security_group_ids": null
+ },
+ "after": {
+ "ami": "ami-0abc",
+ "credit_specification": [],
+ "force_destroy": false,
+ "get_password_data": false,
+ "hibernation": null,
+ "instance_type": "t4g.micro",
+ "launch_template": [],
+ "region": "eu-west-1",
+ "source_dest_check": true,
+ "tags": {
+ "Name": "box"
+ },
+ "tags_all": {
+ "Name": "box"
+ },
+ "timeouts": null,
+ "user_data": null,
+ "user_data_replace_on_change": false,
+ "volume_tags": null
+ },
+ "after_unknown": {
+ "arn": true,
+ "associate_public_ip_address": true,
+ "availability_zone": true,
+ "capacity_reservation_specification": true,
+ "cpu_options": true,
+ "credit_specification": [],
+ "disable_api_stop": true,
+ "disable_api_termination": true,
+ "ebs_block_device": true,
+ "ebs_optimized": true,
+ "enable_primary_ipv6": true,
+ "enclave_options": true,
+ "ephemeral_block_device": true,
+ "host_id": true,
+ "host_resource_group_arn": true,
+ "iam_instance_profile": true,
+ "id": true,
+ "instance_initiated_shutdown_behavior": true,
+ "instance_lifecycle": true,
+ "instance_market_options": true,
+ "instance_state": true,
+ "ipv6_address_count": true,
+ "ipv6_addresses": true,
+ "key_name": true,
+ "launch_template": [],
+ "maintenance_options": true,
+ "metadata_options": true,
+ "monitoring": true,
+ "network_interface": true,
+ "outpost_arn": true,
+ "password_data": true,
+ "placement_group": true,
+ "placement_group_id": true,
+ "placement_partition_number": true,
+ "primary_network_interface": true,
+ "primary_network_interface_id": true,
+ "private_dns": true,
+ "private_dns_name_options": true,
+ "private_ip": true,
+ "public_dns": true,
+ "public_ip": true,
+ "root_block_device": true,
+ "secondary_network_interface": true,
+ "secondary_private_ips": true,
+ "security_groups": true,
+ "spot_instance_request_id": true,
+ "subnet_id": true,
+ "tags": {},
+ "tags_all": {},
+ "tenancy": true,
+ "user_data_base64": true,
+ "vpc_security_group_ids": true
+ },
+ "before_sensitive": {
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "ebs_block_device": [],
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "instance_market_options": [],
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "network_interface": [],
+ "primary_network_interface": [],
+ "private_dns_name_options": [],
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "tags": {},
+ "tags_all": {}
+ },
+ "after_sensitive": {
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "ebs_block_device": [],
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "instance_market_options": [],
+ "ipv6_addresses": [],
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "network_interface": [],
+ "primary_network_interface": [],
+ "private_dns_name_options": [],
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "secondary_private_ips": [],
+ "security_groups": [],
+ "tags": {},
+ "tags_all": {},
+ "vpc_security_group_ids": []
+ },
+ "replace_paths": [
+ [
+ "security_groups"
+ ]
+ ],
+ "before_identity": {
+ "account_id": "111122223333",
+ "id": "i-0fixed1",
+ "region": "eu-west-1"
+ },
+ "after_identity": {
+ "account_id": null,
+ "id": null,
+ "region": null
+ }
+ },
+ "action_reason": "replace_because_cannot_update"
+ },
+ {
+ "address": "aws_lb_target_group.target",
+ "mode": "managed",
+ "type": "aws_lb_target_group",
+ "name": "target",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "change": {
+ "actions": [
+ "create"
+ ],
+ "before": null,
+ "after": {
+ "deregistration_delay": "300",
+ "lambda_multi_value_headers_enabled": false,
+ "name": "t80",
+ "port": 80,
+ "protocol": "TCP",
+ "proxy_protocol_v2": false,
+ "region": "eu-west-1",
+ "slow_start": 0,
+ "tags": null,
+ "target_control_port": null,
+ "target_type": "instance",
+ "vpc_id": "vpc-0abc"
+ },
+ "after_unknown": {
+ "arn": true,
+ "arn_suffix": true,
+ "connection_termination": true,
+ "health_check": true,
+ "id": true,
+ "ip_address_type": true,
+ "load_balancer_arns": true,
+ "load_balancing_algorithm_type": true,
+ "load_balancing_anomaly_mitigation": true,
+ "load_balancing_cross_zone_enabled": true,
+ "name_prefix": true,
+ "preserve_client_ip": true,
+ "protocol_version": true,
+ "stickiness": true,
+ "tags_all": true,
+ "target_failover": true,
+ "target_group_health": true,
+ "target_health_state": true
+ },
+ "before_sensitive": false,
+ "after_sensitive": {
+ "health_check": [],
+ "load_balancer_arns": [],
+ "stickiness": [],
+ "tags_all": {},
+ "target_failover": [],
+ "target_group_health": [],
+ "target_health_state": []
+ },
+ "after_identity": {
+ "arn": null
+ }
+ }
+ }
+ ],
+ "prior_state": {
+ "format_version": "1.0",
+ "terraform_version": "1.12.5",
+ "values": {
+ "root_module": {
+ "resources": [
+ {
+ "address": "aws_eip.public",
+ "mode": "managed",
+ "type": "aws_eip",
+ "name": "public",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 0,
+ "values": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "sensitive_values": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ },
+ "identity_schema_version": 0
+ },
+ {
+ "address": "aws_instance.host",
+ "mode": "managed",
+ "type": "aws_instance",
+ "name": "host",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 2,
+ "values": {
+ "ami": "ami-0abc",
+ "arn": null,
+ "associate_public_ip_address": null,
+ "availability_zone": null,
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "disable_api_stop": null,
+ "disable_api_termination": null,
+ "ebs_block_device": [],
+ "ebs_optimized": null,
+ "enable_primary_ipv6": null,
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "force_destroy": null,
+ "get_password_data": null,
+ "hibernation": null,
+ "host_id": null,
+ "host_resource_group_arn": null,
+ "iam_instance_profile": null,
+ "id": "i-0fixed1",
+ "instance_initiated_shutdown_behavior": null,
+ "instance_lifecycle": null,
+ "instance_market_options": [],
+ "instance_state": null,
+ "instance_type": "t4g.micro",
+ "ipv6_address_count": null,
+ "ipv6_addresses": null,
+ "key_name": null,
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "monitoring": null,
+ "network_interface": [],
+ "outpost_arn": null,
+ "password_data": null,
+ "placement_group": null,
+ "placement_group_id": null,
+ "placement_partition_number": null,
+ "primary_network_interface": [],
+ "primary_network_interface_id": "eni-0fixed1",
+ "private_dns": null,
+ "private_dns_name_options": [],
+ "private_ip": null,
+ "public_dns": null,
+ "public_ip": null,
+ "region": "eu-west-1",
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "secondary_private_ips": null,
+ "security_groups": null,
+ "source_dest_check": null,
+ "spot_instance_request_id": null,
+ "subnet_id": null,
+ "tags": {
+ "Name": "box"
+ },
+ "tags_all": {
+ "Name": "box"
+ },
+ "tenancy": null,
+ "timeouts": null,
+ "user_data": null,
+ "user_data_base64": null,
+ "user_data_replace_on_change": null,
+ "volume_tags": null,
+ "vpc_security_group_ids": null
+ },
+ "sensitive_values": {
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "ebs_block_device": [],
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "instance_market_options": [],
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "network_interface": [],
+ "primary_network_interface": [],
+ "private_dns_name_options": [],
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "tags": {},
+ "tags_all": {}
+ },
+ "identity": {
+ "account_id": "111122223333",
+ "id": "i-0fixed1",
+ "region": "eu-west-1"
+ },
+ "identity_schema_version": 0
+ }
+ ]
+ }
+ }
+ },
+ "timestamp": "2026-11-04T07:33:09Z",
+ "errored": false
+}
diff --git a/scripts/testdata/region-group-plan/tofu-1.12-identity.json b/scripts/testdata/region-group-plan/tofu-1.12-identity.json
new file mode 100644
index 000000000..dbed2b34e
--- /dev/null
+++ b/scripts/testdata/region-group-plan/tofu-1.12-identity.json
@@ -0,0 +1,408 @@
+{
+ "format_version": "1.2",
+ "terraform_version": "1.12.5",
+ "planned_values": {
+ "root_module": {
+ "resources": [
+ {
+ "address": "aws_eip.public",
+ "mode": "managed",
+ "type": "aws_eip",
+ "name": "public",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 0,
+ "values": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "sensitive_values": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ },
+ "identity_schema_version": 0
+ },
+ {
+ "address": "aws_lb_target_group.target",
+ "mode": "managed",
+ "type": "aws_lb_target_group",
+ "name": "target",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 0,
+ "values": {
+ "deregistration_delay": "300",
+ "lambda_multi_value_headers_enabled": false,
+ "name": "t80",
+ "port": 80,
+ "protocol": "TCP",
+ "proxy_protocol_v2": false,
+ "region": "eu-west-1",
+ "slow_start": 0,
+ "tags": null,
+ "target_control_port": null,
+ "target_type": "instance",
+ "vpc_id": "vpc-0abc"
+ },
+ "sensitive_values": {
+ "health_check": [],
+ "load_balancer_arns": [],
+ "stickiness": [],
+ "tags_all": {},
+ "target_failover": [],
+ "target_group_health": [],
+ "target_health_state": []
+ },
+ "identity": {
+ "arn": null
+ },
+ "identity_schema_version": 0
+ }
+ ]
+ }
+ },
+ "resource_changes": [
+ {
+ "address": "aws_eip.public",
+ "mode": "managed",
+ "type": "aws_eip",
+ "name": "public",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "change": {
+ "actions": [
+ "no-op"
+ ],
+ "before": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "after": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "after_unknown": {},
+ "before_sensitive": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "after_sensitive": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "before_identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ },
+ "after_identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ }
+ }
+ },
+ {
+ "address": "aws_lb_target_group.target",
+ "mode": "managed",
+ "type": "aws_lb_target_group",
+ "name": "target",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "change": {
+ "actions": [
+ "create"
+ ],
+ "before": null,
+ "after": {
+ "deregistration_delay": "300",
+ "lambda_multi_value_headers_enabled": false,
+ "name": "t80",
+ "port": 80,
+ "protocol": "TCP",
+ "proxy_protocol_v2": false,
+ "region": "eu-west-1",
+ "slow_start": 0,
+ "tags": null,
+ "target_control_port": null,
+ "target_type": "instance",
+ "vpc_id": "vpc-0abc"
+ },
+ "after_unknown": {
+ "arn": true,
+ "arn_suffix": true,
+ "connection_termination": true,
+ "health_check": true,
+ "id": true,
+ "ip_address_type": true,
+ "load_balancer_arns": true,
+ "load_balancing_algorithm_type": true,
+ "load_balancing_anomaly_mitigation": true,
+ "load_balancing_cross_zone_enabled": true,
+ "name_prefix": true,
+ "preserve_client_ip": true,
+ "protocol_version": true,
+ "stickiness": true,
+ "tags_all": true,
+ "target_failover": true,
+ "target_group_health": true,
+ "target_health_state": true
+ },
+ "before_sensitive": false,
+ "after_sensitive": {
+ "health_check": [],
+ "load_balancer_arns": [],
+ "stickiness": [],
+ "tags_all": {},
+ "target_failover": [],
+ "target_group_health": [],
+ "target_health_state": []
+ },
+ "after_identity": {
+ "arn": null
+ }
+ }
+ }
+ ],
+ "prior_state": {
+ "format_version": "1.0",
+ "terraform_version": "1.12.5",
+ "values": {
+ "root_module": {
+ "resources": [
+ {
+ "address": "aws_eip.public",
+ "mode": "managed",
+ "type": "aws_eip",
+ "name": "public",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 0,
+ "values": {
+ "address": null,
+ "allocation_id": "eipalloc-0new1",
+ "arn": null,
+ "associate_with_private_ip": null,
+ "association_id": null,
+ "carrier_ip": null,
+ "customer_owned_ip": null,
+ "customer_owned_ipv4_pool": null,
+ "domain": "vpc",
+ "id": "eipalloc-0new1",
+ "instance": null,
+ "ipam_pool_id": null,
+ "network_border_group": null,
+ "network_interface": null,
+ "private_dns": null,
+ "private_ip": null,
+ "ptr_record": null,
+ "public_dns": null,
+ "public_ip": "203.0.113.10",
+ "public_ipv4_pool": null,
+ "region": "eu-west-1",
+ "tags": {
+ "Name": "ingress-old"
+ },
+ "tags_all": {
+ "Name": "ingress-old"
+ },
+ "timeouts": null
+ },
+ "sensitive_values": {
+ "tags": {},
+ "tags_all": {}
+ },
+ "identity": {
+ "account_id": "111122223333",
+ "id": "eipalloc-0new1",
+ "region": "eu-west-1"
+ },
+ "identity_schema_version": 0
+ },
+ {
+ "address": "aws_instance.host",
+ "mode": "managed",
+ "type": "aws_instance",
+ "name": "host",
+ "provider_name": "registry.opentofu.org/hashicorp/aws",
+ "schema_version": 2,
+ "values": {
+ "ami": "ami-0abc",
+ "arn": null,
+ "associate_public_ip_address": null,
+ "availability_zone": null,
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "disable_api_stop": null,
+ "disable_api_termination": null,
+ "ebs_block_device": [],
+ "ebs_optimized": null,
+ "enable_primary_ipv6": null,
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "force_destroy": null,
+ "get_password_data": null,
+ "hibernation": null,
+ "host_id": null,
+ "host_resource_group_arn": null,
+ "iam_instance_profile": null,
+ "id": "i-0fixed1",
+ "instance_initiated_shutdown_behavior": null,
+ "instance_lifecycle": null,
+ "instance_market_options": [],
+ "instance_state": null,
+ "instance_type": "t4g.micro",
+ "ipv6_address_count": null,
+ "ipv6_addresses": null,
+ "key_name": null,
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "monitoring": null,
+ "network_interface": [],
+ "outpost_arn": null,
+ "password_data": null,
+ "placement_group": null,
+ "placement_group_id": null,
+ "placement_partition_number": null,
+ "primary_network_interface": [],
+ "primary_network_interface_id": "eni-0fixed1",
+ "private_dns": null,
+ "private_dns_name_options": [],
+ "private_ip": null,
+ "public_dns": null,
+ "public_ip": null,
+ "region": "eu-west-1",
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "secondary_private_ips": null,
+ "security_groups": null,
+ "source_dest_check": null,
+ "spot_instance_request_id": null,
+ "subnet_id": null,
+ "tags": {
+ "Name": "box"
+ },
+ "tags_all": {
+ "Name": "box"
+ },
+ "tenancy": null,
+ "timeouts": null,
+ "user_data": null,
+ "user_data_base64": null,
+ "user_data_replace_on_change": null,
+ "volume_tags": null,
+ "vpc_security_group_ids": null
+ },
+ "sensitive_values": {
+ "capacity_reservation_specification": [],
+ "cpu_options": [],
+ "credit_specification": [],
+ "ebs_block_device": [],
+ "enclave_options": [],
+ "ephemeral_block_device": [],
+ "instance_market_options": [],
+ "launch_template": [],
+ "maintenance_options": [],
+ "metadata_options": [],
+ "network_interface": [],
+ "primary_network_interface": [],
+ "private_dns_name_options": [],
+ "root_block_device": [],
+ "secondary_network_interface": [],
+ "tags": {},
+ "tags_all": {}
+ },
+ "identity": {
+ "account_id": "111122223333",
+ "id": "i-0fixed1",
+ "region": "eu-west-1"
+ },
+ "identity_schema_version": 0
+ }
+ ]
+ }
+ }
+ },
+ "timestamp": "2026-11-04T07:33:09Z",
+ "errored": false
+}