region HA P3b-1 fixes: gzip group user data, gate group cleanup
F1: the group launch template's user data was ~22.8 KB encoded against EC2's 16384 B cap. It is now base64gzip'd (7.7 KB with the real dev inputs); a precondition fails plan above 13107 B (20% headroom), a Go guard enforces it in CI, and a witness proves the decoded script equals the plain render. The queue URL is derived so the size is plan-known; an apply-time precondition pins it to the provider id. F2: the plan gate spares only modules proven to be group modules (constant mode "group", no fixed-mode marker under the prefix); every other module keeps every refusal. The cleanup manifest admits the group's own resources. Fixtures: group destroys approved, fixed-box IAM refused. Astra implemented; Opus reviewed (R1 ready after fixes, R2 ready); census region-ha-p3b1-fixes approved by Opus on #280. #421. Co-Authored-By: GPT-6 Astra <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from region-ha-p3b1-fixes into main.
16 files changed,
+6,488
−46
docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md+27 −0infra/modules/region-host/group.tf+32 −21infra/modules/region-host/tests/group.tftest.hcl+7 −3infra/modules/region-host/tests/group_alarms.tftest.hcl+4 −0infra/modules/region-host/tests/group_user_data.tftest.hcl+180 −0internal/provision/region_group_guards_test.go+212 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv+13 −0scripts/check-region-group-plan.py+121 −19scripts/check_region_group_plan_test.py+333 −0scripts/region_group_contract_test.py+53 −3scripts/testdata/region-group-plan/dev-boot-config.json+17 −0scripts/testdata/region-group-plan/tofu-1.12-fixed-remnants-group-mode.json+130 −0scripts/testdata/region-group-plan/tofu-1.12-group-create.json+1,740 −0scripts/testdata/region-group-plan/tofu-1.12-group-full-destroy.json+1,942 −0scripts/testdata/region-group-plan/tofu-1.12-group-partial-destroy.json+1,676 −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| new file mode 100644 |
| index 000000000..0ae97959d |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md |
| @@ -0,0 +1,27 @@ |
| +# Census approval: region-ha-p3b1-fixes |
| + |
| +Ruling `census-ruling-region-ha-p3b1-fixes`. The independent reviewer approves or rejects every change below, 1 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) | 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. | |
| +| `infra/modules/region-host/tests/group.tftest.hcl` `external` | body | unchanged (1) | 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. | |
| +| `infra/modules/region-host/tests/group_alarms.tftest.hcl` `external` | body | unchanged (1) | 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. | |
| + |
| +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.;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 |
| +- `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.;rev3=census-ruling-region-ha-group-rtb;basis=Two mock runs: implicit main route table, explicit association wins; test-only Terraform |
| +- `infra/modules/region-host/tests/group_alarms.tftest.hcl` `external`: legacy, task accepted-legacy. Basis: 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. |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `infra/modules/region-host/tests/group_user_data.tftest.hcl:external`: reads +file:external; written legacy, accepted-legacy, frozen |
| + |
| +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/group.tf b/infra/modules/region-host/group.tf| index a40a4efa9..71684a9a0 100644 |
| --- a/infra/modules/region-host/group.tf |
| +++ b/infra/modules/region-host/group.tf |
| @@ -29,6 +29,28 @@ locals { |
| target_group_arns = module.group_ingress[0].target_group_arns |
| public_ips = module.group_ingress[0].public_ips |
| } |
| + group_termination_queue_url = local.group_enabled ? "https://sqs.${data.aws_region.current.region}.${data.aws_partition.current[0].dns_suffix}/${data.aws_caller_identity.current.account_id}/${aws_sqs_queue.terminations.name}" : null |
| + group_init_script = local.group_enabled ? templatefile("${path.module}/group-init.sh.tftpl", { |
| + # POSIX single-quote escaping keeps even provider-computed values inert. |
| + config = { for key, value in { |
| + CARLOS_DEPLOYMENT = var.group_config.deployment |
| + CARLOS_DEPLOYMENT_BUCKET = trimprefix(var.deployment_bucket_arn, "arn:${data.aws_partition.current[0].partition}:s3:::") |
| + CARLOS_REGION = var.group_config.region |
| + CARLOS_PLACEMENT_REGION = var.group_config.placement_region |
| + AWS_REGION = data.aws_region.current.region |
| + CARLOS_POOLS = join(",", sort(tolist(var.group_config.pools))) |
| + CARLOS_BOOTSTRAP_OBJECT_KEY = "${local.group_ssm_path}/boot/bootstrap-object" |
| + CARLOS_BOOTSTRAP_HASH_KEY = "${local.group_ssm_path}/boot/bootstrap-sha256" |
| + CARLOS_INGRESS_KEY = "${local.group_ssm_path}/boot/ingress" |
| + CARLOS_GROUP_DATA_BUCKET = trimprefix(var.data_bucket_arn, "arn:${data.aws_partition.current[0].partition}:s3:::") |
| + CARLOS_GROUP_ACCOUNT = data.aws_caller_identity.current.account_id |
| + CARLOS_GROUP_NAME = var.name |
| + CARLOS_LAUNCH_HOOK_NAME = local.group_hook_name |
| + CARLOS_TERMINATION_QUEUE_URL = local.group_termination_queue_url |
| + CARLOS_RELEASE = var.group_config.release |
| + } : key => "'${replace(value, "'", "'\"'\"'")}'" } |
| + }) : null |
| + group_user_data = local.group_enabled ? base64gzip(local.group_init_script) : null |
| } |
| # A caller reusing P3a ingress passes its outputs. Only a new region owns a child. |
| @@ -195,28 +217,17 @@ resource "aws_launch_template" "group" { |
| delete_on_termination = true |
| } |
| } |
| - user_data = base64encode(templatefile("${path.module}/group-init.sh.tftpl", { |
| - # POSIX single-quote escaping keeps even provider-computed values inert. |
| - config = { for key, value in { |
| - CARLOS_DEPLOYMENT = var.group_config.deployment |
| - CARLOS_DEPLOYMENT_BUCKET = trimprefix(var.deployment_bucket_arn, "arn:${data.aws_partition.current[0].partition}:s3:::") |
| - CARLOS_REGION = var.group_config.region |
| - CARLOS_PLACEMENT_REGION = var.group_config.placement_region |
| - AWS_REGION = data.aws_region.current.region |
| - CARLOS_POOLS = join(",", sort(tolist(var.group_config.pools))) |
| - CARLOS_BOOTSTRAP_OBJECT_KEY = "${local.group_ssm_path}/boot/bootstrap-object" |
| - CARLOS_BOOTSTRAP_HASH_KEY = "${local.group_ssm_path}/boot/bootstrap-sha256" |
| - CARLOS_INGRESS_KEY = "${local.group_ssm_path}/boot/ingress" |
| - CARLOS_GROUP_DATA_BUCKET = trimprefix(var.data_bucket_arn, "arn:${data.aws_partition.current[0].partition}:s3:::") |
| - CARLOS_GROUP_ACCOUNT = data.aws_caller_identity.current.account_id |
| - CARLOS_GROUP_NAME = var.name |
| - CARLOS_LAUNCH_HOOK_NAME = local.group_hook_name |
| - CARLOS_TERMINATION_QUEUE_URL = aws_sqs_queue.terminations.id |
| - CARLOS_RELEASE = var.group_config.release |
| - } : key => "'${replace(value, "'", "'\"'\"'")}'" } |
| - })) |
| - tags = local.group_tags |
| + user_data = local.group_user_data |
| + tags = local.group_tags |
| lifecycle { |
| + precondition { |
| + condition = aws_sqs_queue.terminations.id == local.group_termination_queue_url |
| + error_message = "the group must own its termination queue and regional queue selection" |
| + } |
| + precondition { |
| + condition = length(local.group_user_data) <= floor(16384 * 0.8) |
| + error_message = "encoded user data length exceeds floor(16384 * 0.8) = 13107 bytes" |
| + } |
| precondition { |
| condition = data.aws_ami.group[0].root_device_type == "ebs" && can(regex("^/dev/[a-zA-Z0-9]+$", data.aws_ami.group[0].root_device_name)) |
| error_message = "the pinned group AMI must have an EBS root device" |
diff --git a/infra/modules/region-host/tests/group.tftest.hcl b/infra/modules/region-host/tests/group.tftest.hcl| index d8cbe0076..15533596c 100644 |
| --- a/infra/modules/region-host/tests/group.tftest.hcl |
| +++ b/infra/modules/region-host/tests/group.tftest.hcl |
| @@ -424,15 +424,19 @@ run "new_ingress_owner" { |
| run "group_boot_quotes" { |
| command = plan |
| + override_data { |
| + target = data.aws_partition.current |
| + values = { partition = "aws", dns_suffix = "amazonaws.com'$(printf injected)'" } |
| + } |
| override_resource { |
| target = aws_sqs_queue.terminations |
| values = { |
| arn = "arn:aws:sqs:eu-west-1:123456789012:carlos-dev-ie-group-terminations" |
| - id = "https://sqs.eu-west-1.amazonaws.com/123456789012/queue'$(printf injected)'" |
| + id = "https://sqs.eu-west-1.amazonaws.com'$(printf injected)'/123456789012/carlos-dev-ie-group-terminations" |
| } |
| } |
| assert { |
| - condition = strcontains(base64decode(aws_launch_template.group[0].user_data), "TASK 3") |
| + condition = strcontains(local.group_init_script, "TASK 3") |
| error_message = "the group template must reserve the boot steps for Task 3" |
| } |
| } |
| @@ -456,7 +460,7 @@ run "group_home_placement" { |
| } |
| } |
| assert { |
| - condition = strcontains(base64decode(aws_launch_template.group[0].user_data), "CARLOS_PLACEMENT_REGION=''") |
| + condition = strcontains(local.group_init_script, "CARLOS_PLACEMENT_REGION=''") |
| error_message = "group home placement must remain empty beside its canonical region" |
| } |
| } |
diff --git a/infra/modules/region-host/tests/group_alarms.tftest.hcl b/infra/modules/region-host/tests/group_alarms.tftest.hcl| index 50bea336a..d302d8339 100644 |
| --- a/infra/modules/region-host/tests/group_alarms.tftest.hcl |
| +++ b/infra/modules/region-host/tests/group_alarms.tftest.hcl |
| @@ -169,6 +169,10 @@ override_resource { |
| } |
| run "group_alarm_producers" { |
| command = plan |
| + override_resource { |
| + target = aws_sqs_queue.terminations |
| + values = { arn = "arn:aws:sqs:eu-west-1:123456789012:carlos-dev-ie-group-terminations", id = "https://sqs.eu-west-1.amazonaws.com/123456789012/carlos-dev-ie-group-terminations" } |
| + } |
| variables { |
| alerts_email = "ops@example.com" |
| termination_queue_alarm = true |
diff --git a/infra/modules/region-host/tests/group_user_data.tftest.hcl b/infra/modules/region-host/tests/group_user_data.tftest.hcl| new file mode 100644 |
| index 000000000..bf7ef1a99 |
| --- /dev/null |
| +++ b/infra/modules/region-host/tests/group_user_data.tftest.hcl |
| @@ -0,0 +1,180 @@ |
| +mock_provider "aws" { |
| + mock_resource "aws_launch_template" { defaults = { id = "lt-0123456789abcdef0" } } |
| + mock_resource "aws_security_group" { defaults = { id = "sg-0123456789abcdef1" } } |
| +} |
| +override_data { |
| + target = data.aws_region.current |
| + values = { region = "eu-west-1" } |
| +} |
| +override_data { |
| + target = data.aws_partition.current |
| + values = { partition = "aws", dns_suffix = "amazonaws.com" } |
| +} |
| +override_data { |
| + target = data.aws_caller_identity.current |
| + values = { account_id = "640012953448" } |
| +} |
| +override_data { |
| + target = data.aws_vpc.host |
| + values = { cidr_block = "10.0.0.0/16", cidr_block_associations = [] } |
| +} |
| +override_data { |
| + target = data.aws_subnets.group |
| + values = { ids = ["subnet-0502e41d505e0450f", "subnet-0975dda9ac0e65347"] } |
| +} |
| +override_data { |
| + target = data.aws_route_table.group |
| + values = { routes = [{ cidr_block = "0.0.0.0/0", gateway_id = "igw-0123456789abcdef0", carrier_gateway_id = "", core_network_arn = "", destination_prefix_list_id = "", egress_only_gateway_id = "", instance_id = "", ipv6_cidr_block = "", local_gateway_id = "", nat_gateway_id = "", network_interface_id = "", odb_network_arn = "", transit_gateway_id = "", vpc_endpoint_id = "", vpc_peering_connection_id = "" }] } |
| +} |
| +override_data { |
| + target = data.aws_lb.group |
| + values = { |
| + vpc_id = "vpc-02212d67a9fca3b20" |
| + internal = false |
| + load_balancer_type = "network" |
| + ip_address_type = "ipv4" |
| + enable_cross_zone_load_balancing = true |
| + security_groups = ["sg-075e6d9267b33ecad"] |
| + subnet_mapping = [ |
| + { subnet_id = "subnet-0502e41d505e0450f", allocation_id = "eipalloc-08e89e7941e0a208f", ipv6_address = "", outpost_id = "", private_ipv4_address = "" }, |
| + { subnet_id = "subnet-0975dda9ac0e65347", allocation_id = "eipalloc-0ed8f1f952b0fd2d2", ipv6_address = "", outpost_id = "", private_ipv4_address = "" } |
| + ] |
| + } |
| +} |
| +override_data { |
| + target = data.aws_lb_target_group.group_http |
| + values = { vpc_id = "vpc-02212d67a9fca3b20", port = 80, protocol = "TCP", target_type = "instance", load_balancer_arns = ["arn:aws:elasticloadbalancing:eu-west-1:640012953448:loadbalancer/net/carlos-dev-ie-nlb/45da5de177dd7c19"], preserve_client_ip = "true" } |
| +} |
| +override_data { |
| + target = data.aws_lb_target_group.group_https |
| + values = { vpc_id = "vpc-02212d67a9fca3b20", port = 443, protocol = "TCP", target_type = "instance", load_balancer_arns = ["arn:aws:elasticloadbalancing:eu-west-1:640012953448:loadbalancer/net/carlos-dev-ie-nlb/45da5de177dd7c19"], preserve_client_ip = "true" } |
| +} |
| +override_data { |
| + target = data.aws_eip.group["eu-west-1a"] |
| + values = { public_ip = "54.77.110.223" } |
| +} |
| +override_data { |
| + target = data.aws_eip.group["eu-west-1c"] |
| + values = { public_ip = "18.203.21.74" } |
| +} |
| +override_resource { |
| + 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/carlos-dev-ie-group-terminations" } |
| +} |
| +override_resource { |
| + target = aws_cloudwatch_event_rule.terminations |
| + values = { arn = "arn:aws:events:eu-west-1:640012953448:rule/carlos-dev-ie-group-terminations" } |
| +} |
| +override_resource { |
| + target = aws_iam_role.host |
| + values = { id = "carlos-dev-ie-group", arn = "arn:aws:iam::640012953448:role/carlos-dev-ie-group" } |
| +} |
| +override_resource { |
| + target = aws_sns_topic.alerts |
| + values = { arn = "arn:aws:sns:eu-west-1:640012953448:carlos-dev-ie-group-alerts" } |
| +} |
| +override_data { |
| + target = data.aws_ami.group |
| + values = { id = "ami-020434b3e0470d552", root_device_name = "/dev/xvda", root_device_type = "ebs" } |
| +} |
| +variables { |
| + mode = "group" |
| + box_count = 2 |
| + name = "carlos-dev-ie-group" |
| + sg_description = "carlos dev IE group (P3b-1, disposable)" |
| + iam_name = "carlos-dev-ie-group" |
| + instance_type = "t4g.micro" |
| + root_volume_size = 20 |
| + user_data = "" |
| + ssm_parameter_arn = "" |
| + vpc_id = "vpc-02212d67a9fca3b20" |
| + deployment_bucket_arn = "arn:aws:s3:::carlos-dev-640012953448" |
| + data_bucket_arn = "arn:aws:s3:::carlos-dev-ie-640012953448" |
| + alerts_email = "paul@rslw.com" |
| + group_config = { |
| + deployment = "dev" |
| + region = "ie" |
| + placement_region = "" |
| + pools = ["hapair"] |
| + ami_id = "ami-020434b3e0470d552" |
| + release = "v0.34.2" |
| + configuration_kms_key_arn = "arn:aws:kms:eu-west-1:640012953448:key/67c17304-3f76-4ad6-94a1-5b6e174c73cd" |
| + } |
| + group_zones = { |
| + "eu-west-1a" = { subnet_id = "subnet-0502e41d505e0450f", allocation_id = "eipalloc-08e89e7941e0a208f" } |
| + "eu-west-1c" = { subnet_id = "subnet-0975dda9ac0e65347", allocation_id = "eipalloc-0ed8f1f952b0fd2d2" } |
| + } |
| + group_ingress = { |
| + nlb_arn = "arn:aws:elasticloadbalancing:eu-west-1:640012953448:loadbalancer/net/carlos-dev-ie-nlb/45da5de177dd7c19" |
| + nlb_security_group_id = "sg-075e6d9267b33ecad" |
| + target_group_arns = { |
| + "80" = "arn:aws:elasticloadbalancing:eu-west-1:640012953448:targetgroup/carlos-dev-ie-nlb-80/2f5186277337ce74" |
| + "443" = "arn:aws:elasticloadbalancing:eu-west-1:640012953448:targetgroup/carlos-dev-ie-nlb-443/c33262405df2e5df" |
| + } |
| + public_ips = { "eu-west-1a" = "54.77.110.223", "eu-west-1c" = "18.203.21.74" } |
| + } |
| +} |
| + |
| +run "real_dev_user_data" { |
| + command = plan |
| + assert { |
| + condition = length(aws_launch_template.group[0].user_data) <= 13107 |
| + error_message = "the encoded group user data must stay within 13107 characters" |
| + } |
| + assert { |
| + condition = aws_launch_template.group[0].user_data == base64gzip(templatefile("${path.module}/group-init.sh.tftpl", { |
| + config = { for key, value in { |
| + CARLOS_DEPLOYMENT = var.group_config.deployment |
| + CARLOS_DEPLOYMENT_BUCKET = trimprefix(var.deployment_bucket_arn, "arn:${data.aws_partition.current[0].partition}:s3:::") |
| + CARLOS_REGION = var.group_config.region |
| + CARLOS_PLACEMENT_REGION = var.group_config.placement_region |
| + AWS_REGION = data.aws_region.current.region |
| + CARLOS_POOLS = join(",", sort(tolist(var.group_config.pools))) |
| + CARLOS_BOOTSTRAP_OBJECT_KEY = "${local.group_ssm_path}/boot/bootstrap-object" |
| + CARLOS_BOOTSTRAP_HASH_KEY = "${local.group_ssm_path}/boot/bootstrap-sha256" |
| + CARLOS_INGRESS_KEY = "${local.group_ssm_path}/boot/ingress" |
| + CARLOS_GROUP_DATA_BUCKET = trimprefix(var.data_bucket_arn, "arn:${data.aws_partition.current[0].partition}:s3:::") |
| + CARLOS_GROUP_ACCOUNT = data.aws_caller_identity.current.account_id |
| + CARLOS_GROUP_NAME = var.name |
| + CARLOS_LAUNCH_HOOK_NAME = local.group_hook_name |
| + CARLOS_TERMINATION_QUEUE_URL = aws_sqs_queue.terminations.id |
| + CARLOS_RELEASE = var.group_config.release |
| + } : key => "'${replace(value, "'", "'\"'\"'")}'" } |
| + })) |
| + error_message = "the launch template user data must be the gzip of the rendered group init template" |
| + } |
| + assert { |
| + condition = local.group_user_data == base64gzip(local.group_init_script) |
| + error_message = "the group user data must be the gzip of the plain group init script" |
| + } |
| +} |
| + |
| +run "oversize_user_data" { |
| + command = plan |
| + variables { |
| + group_config = { |
| + deployment = "dev" |
| + region = "ie" |
| + placement_region = "" |
| + pools = ["hapair"] |
| + ami_id = "ami-020434b3e0470d552" |
| + release = "v0.34.2-${join("", [for index in range(1024) : sha256(tostring(index))])}" |
| + 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] |
| +} |
| + |
| +run "queue_url_mismatch" { |
| + command = plan |
| + override_resource { |
| + 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| new file mode 100644 |
| index 000000000..7b43b92da |
| --- /dev/null |
| +++ b/internal/provision/region_group_guards_test.go |
| @@ -0,0 +1,212 @@ |
| +package provision |
| + |
| +import ( |
| + "bytes" |
| + "compress/gzip" |
| + "encoding/base64" |
| + "encoding/json" |
| + "io" |
| + "os" |
| + "os/exec" |
| + "path/filepath" |
| + "regexp" |
| + "slices" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +func groupGuardFile(t *testing.T, name string) []byte { |
| + t.Helper() |
| + b, err := os.ReadFile(filepath.Join("../..", name)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return b |
| +} |
| + |
| +func groupDevConfig(t *testing.T) map[string]string { |
| + t.Helper() |
| + var config map[string]string |
| + if err := json.Unmarshal(groupGuardFile(t, "scripts/testdata/region-group-plan/dev-boot-config.json"), &config); err != nil { |
| + t.Fatal(err) |
| + } |
| + return config |
| +} |
| + |
| +// This renderer implements the template's one sorted map loop, whitespace |
| +// trimming and escaped interpolation. Refuse new template syntax instead of |
| +// estimating it. The offline OpenTofu witness below compares every byte. |
| +func renderGroupScript(t *testing.T, config map[string]string) []byte { |
| + t.Helper() |
| + template := string(groupGuardFile(t, "infra/modules/region-host/group-init.sh.tftpl")) |
| + loop := "%{ for key, value in config ~}\n${key}=${value}\nexport ${key}\n%{ endfor ~}\n" |
| + if strings.Count(template, loop) != 1 { |
| + t.Fatal("group template loop changed; update the renderer and OpenTofu witness") |
| + } |
| + var keys []string |
| + for key := range config { |
| + keys = append(keys, key) |
| + } |
| + slices.Sort(keys) |
| + var assignments strings.Builder |
| + for _, key := range keys { |
| + assignments.WriteString(key + "='" + strings.ReplaceAll(config[key], "'", "'\"'\"'") + "'\nexport " + key + "\n") |
| + } |
| + rest := strings.Replace(template, loop, "", 1) |
| + rest = strings.ReplaceAll(strings.ReplaceAll(rest, "$${", ""), "%%{", "") |
| + if strings.Contains(rest, "${") || strings.Contains(rest, "%{") { |
| + t.Fatal("unhandled group template syntax") |
| + } |
| + rendered := strings.Replace(template, loop, assignments.String(), 1) |
| + return []byte(strings.ReplaceAll(strings.ReplaceAll(rendered, "$${", "${"), "%%{", "%{")) |
| +} |
| + |
| +// OpenTofu uses gzip.NewWriter, Write, Flush, Close, then standard base64. |
| +// Compressor revisions can change the encoded bytes; both sizes are checked. |
| +func encodeGroupScript(t *testing.T, script []byte) string { |
| + t.Helper() |
| + var compressed bytes.Buffer |
| + writer := gzip.NewWriter(&compressed) |
| + if _, err := writer.Write(script); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := writer.Flush(); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := writer.Close(); err != nil { |
| + t.Fatal(err) |
| + } |
| + return base64.StdEncoding.EncodeToString(compressed.Bytes()) |
| +} |
| + |
| +func TestRegionGroupUserDataSize(t *testing.T) { |
| + script := renderGroupScript(t, groupDevConfig(t)) |
| + encoded := encodeGroupScript(t, script) |
| + t.Logf("dev user data: plain=%d old base64=%d gzip+base64=%d limit=13107", len(script), base64.StdEncoding.EncodedLen(len(script)), len(encoded)) |
| + if len(encoded) > 13107 { |
| + t.Fatalf("group user data is %d bytes; limit 13107 (80%% of 16384)", len(encoded)) |
| + } |
| + module := string(groupGuardFile(t, "infra/modules/region-host/group.tf")) |
| + config := groupDevConfig(t) |
| + _, 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") |
| + } |
| + for _, match := range declared { |
| + if _, ok := config[match[1]]; !ok { |
| + t.Fatalf("dev fixture missing %s", match[1]) |
| + } |
| + } |
| + for _, pattern := range []string{ |
| + `group_user_data\s*=\s*local.group_enabled \? base64gzip\(local.group_init_script\) : null`, |
| + `user_data\s*=\s*local.group_user_data`, |
| + `condition\s*=\s*length\(local.group_user_data\) <= floor\(16384 \* 0.8\)`, |
| + } { |
| + if !regexp.MustCompile(pattern).MatchString(module) { |
| + t.Fatalf("group encoding or plan guard changed: %s", pattern) |
| + } |
| + } |
| +} |
| + |
| +func groupGuardBinary(t *testing.T, name string) string { |
| + t.Helper() |
| + binary, err := exec.LookPath(name) |
| + if err == nil { |
| + return binary |
| + } |
| + if os.Getenv("CI") != "" || os.Getenv("AMADAN_CI") != "" { |
| + t.Fatalf("%s is required in CI: %v", name, err) |
| + } |
| + t.Skipf("%s is not installed: %v", name, err) |
| + return "" |
| +} |
| + |
| +func TestRegionGroupUserDataOpenTofu(t *testing.T) { |
| + 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, "'", "'\"'\"'") + "'" |
| + } |
| + values, err := json.Marshal(config) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + template, err := filepath.Abs("../../infra/modules/region-host/group-init.sh.tftpl") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + templateJSON, _ := json.Marshal(template) |
| + module := string(groupGuardFile(t, "infra/modules/region-host/group.tf")) |
| + expression := regexp.MustCompile(`(?m)^\s*group_user_data\s*=([^\n]+)`).FindStringSubmatch(module) |
| + if len(expression) != 2 { |
| + t.Fatal("missing module user-data expression") |
| + } |
| + root := "locals {\n group_enabled = true\n group_init_script = templatefile(" + string(templateJSON) + ", { config = " + string(values) + " })\n group_user_data = " + expression[1] + "\n}\n" |
| + dir := t.TempDir() |
| + if err := os.WriteFile(filepath.Join(dir, "main.tf"), []byte(root), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + cmd := exec.Command(tofu, "console", "-no-color") |
| + cmd.Dir = dir |
| + cmd.Stdin = strings.NewReader("jsonencode({plain=local.group_init_script,encoded=local.group_user_data})\n") |
| + output, err := cmd.CombinedOutput() |
| + if err != nil { |
| + t.Fatalf("offline OpenTofu witness: %v\n%s", err, output) |
| + } |
| + var unquoted string |
| + if err := json.Unmarshal(output, &unquoted); err != nil { |
| + t.Fatalf("%v: %s", err, output) |
| + } |
| + var result struct { |
| + Plain string |
| + Encoded string |
| + } |
| + if err := json.Unmarshal([]byte(unquoted), &result); err != nil { |
| + t.Fatal(err) |
| + } |
| + compressed, err := base64.StdEncoding.DecodeString(result.Encoded) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + reader, err := gzip.NewReader(bytes.NewReader(compressed)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + decoded, err := io.ReadAll(reader) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := reader.Close(); err != nil { |
| + t.Fatal(err) |
| + } |
| + plain := renderGroupScript(t, groupDevConfig(t)) |
| + if !bytes.Equal(decoded, []byte(result.Plain)) || !bytes.Equal(decoded, plain) { |
| + t.Fatal("OpenTofu gzip payload differs from the plain template render") |
| + } |
| + t.Logf("OpenTofu encoded size=%d; Go encoded size=%d", len(result.Encoded), len(encodeGroupScript(t, plain))) |
| + if len(result.Encoded) > 13107 { |
| + t.Fatalf("OpenTofu encoded user data exceeds 13107 bytes: %d", len(result.Encoded)) |
| + } |
| +} |
| + |
| +func TestRegionGroupPythonGuards(t *testing.T) { |
| + python := groupGuardBinary(t, "python3") |
| + cmd := exec.Command(python, "-B", "-m", "unittest", "-v", "scripts.check_region_group_plan_test", "scripts.region_group_contract_test") |
| + cmd.Dir = "../.." |
| + output, err := cmd.CombinedOutput() |
| + if err != nil { |
| + t.Fatalf("region group Python guards: %v\n%s", err, output) |
| + } |
| + t.Logf("%s", output) |
| +} |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index d9cc40bbc..712863dfe 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -87,3 +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 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| new file mode 100644 |
| index 000000000..00e45b2a4 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-region-ha-p3b1-fixes.tsv |
| @@ -0,0 +1,13 @@ |
| +# Census overlay region-ha-p3b1-fixes, written by census-propose (#369). census-ruling-region-ha-p3b1-fixes, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-region-ha-p3b1-fixes.md. |
| +# 3 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| +@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 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. 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 182c28071adef6a9051ce634625a1114c9b831ae8e9eae8c2985de91d1661454 |
diff --git a/scripts/check-region-group-plan.py b/scripts/check-region-group-plan.py| index c95874082..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. |
| @@ -33,6 +43,28 @@ DISPOSABLE = {('aws_eip', 'public'), ('aws_lb', 'nlb'), ('aws_security_group', ' |
| ('aws_lb_target_group', 'target'), ('aws_lb_listener', 'tcp'), |
| ('aws_lb_target_group_attachment', 'fixed'), |
| ('aws_autoscaling_group', 'group'), ('aws_launch_template', 'group')} |
| +# Managed resources region-host creates in group mode (main.tf and group*.tf). |
| +# A cleanup manifest may name these only inside a proven group module. |
| +GROUP_DISPOSABLE = { |
| + ('aws_iam_role', 'host'), ('aws_iam_instance_profile', 'host'), |
| + ('aws_iam_role_policy', 'host_buckets'), ('aws_iam_role_policy', 'host_route53'), |
| + ('aws_iam_role_policy', 'host_steering'), ('aws_iam_role_policy', 'host_metrics'), |
| + ('aws_iam_role_policy', 'host_ssm_parameter_scope'), |
| + ('aws_iam_role_policy', 'host_release_key_deny'), ('aws_iam_role_policy', 'host_terminations'), |
| + ('aws_iam_role_policy', 'group'), ('aws_iam_role_policy_attachment', 'host_ssm'), |
| + ('aws_sns_topic', 'alerts'), ('aws_sns_topic_subscription', 'alerts_email'), |
| + ('aws_sqs_queue', 'terminations'), ('aws_sqs_queue_policy', 'terminations'), |
| + ('aws_cloudwatch_event_rule', 'terminations'), ('aws_cloudwatch_event_target', 'terminations'), |
| + ('aws_security_group', 'group'), ('aws_launch_template', 'group'), |
| + ('aws_autoscaling_group', 'group'), ('aws_ssm_parameter', 'group_queue'), |
| + ('aws_ssm_parameter', 'group_ingress'), |
| + ('aws_cloudwatch_metric_alarm', 'termination_queue_age'), |
| + ('aws_cloudwatch_metric_alarm', 'group_capacity'), ('aws_cloudwatch_metric_alarm', 'group_memory'), |
| + ('aws_cloudwatch_metric_alarm', 'group_clock'), |
| + ('aws_cloudwatch_metric_alarm', 'group_clock_missing'), |
| + ('aws_cloudwatch_event_rule', 'group_launch_failed'), |
| + ('aws_cloudwatch_event_target', 'group_launch_failed'), |
| + ('aws_sns_topic_policy', 'group_launch_failed')} |
| MISSING = object() |
| @@ -51,9 +83,65 @@ def address_parts(address): |
| return ADDRESS.fullmatch(address) |
| -def fixed(kind, name): |
| - return (kind == 'aws_instance' or kind in RULES or |
| - kind in {'aws_security_group', 'aws_eip'} and name == 'host' or |
| +def module_prefix(address, parts): |
| + return address[:parts.start('data') if parts['data'] else parts.start('type')] |
| + |
| + |
| +def group_module(document, prefix): |
| + # Only an unindexed call whose mode is the literal "group" is proven. |
| + # Each enclosing call must resolve exactly and carry no count or for_each. |
| + if not re.fullmatch(rf'(?:module\.{IDENT}\.)+', prefix): |
| + return False |
| + configuration = document.get('configuration') |
| + module = configuration.get('root_module') if isinstance(configuration, dict) else None |
| + call = None |
| + for name in re.findall(rf'module\.({IDENT})\.', prefix): |
| + calls = module.get('module_calls') if isinstance(module, dict) else None |
| + call = calls.get(name) if isinstance(calls, dict) else None |
| + if (not isinstance(call, dict) or |
| + 'count_expression' in call or 'for_each_expression' in call): |
| + return False |
| + module = call.get('module') |
| + expressions = call.get('expressions') |
| + return isinstance(expressions, dict) and same(expressions.get('mode'), {'constant_value': 'group'}) |
| + |
| + |
| +def group_modules(document, rows): |
| + # 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'), row.get('name'))) |
| + if 'previous_address' in row: |
| + found.append((row['previous_address'], None, None)) |
| + for section in ['prior_state', 'planned_values']: |
| + found += [(row.get('address'), row.get('type'), row.get('name')) |
| + for row in state_resources(document, section)] |
| + prefixes, boxes = set(), [] |
| + for address, kind, name in found: |
| + parts = address_parts(address) |
| + if parts is None: |
| + 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']} 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)} |
| + |
| + |
| +def fixed(kind, name, prefix, groups): |
| + if kind == 'aws_instance' or kind in RULES: |
| + return True |
| + if prefix in groups: |
| + return False |
| + return (kind in {'aws_security_group', 'aws_eip'} and name == 'host' or |
| kind == 'aws_cloudwatch_metric_alarm' and name == 'host_auto_recover' or |
| kind in HOST_IAM and (name == 'host' or name.startswith('host_') or |
| name == 'store_user_boundary')) |
| @@ -85,7 +173,7 @@ def changes(document): |
| return rows + drift |
| -def parse_resource(row): |
| +def parse_resource(row, groups): |
| if not isinstance(row, dict): |
| raise Refused(UNKNOWN % '<resource>') |
| address = row.get('address') |
| @@ -115,8 +203,13 @@ def parse_resource(row): |
| previous = row.get('previous_address') |
| if previous is not None: |
| old = address_parts(previous) |
| + prefix = module_prefix(address, parts) |
| + if (old is not None and module_prefix(previous, old) != prefix and |
| + (module_prefix(previous, old) in groups or prefix in groups)): |
| + raise Refused(FIXED % (address, '/'.join(actions))) |
| if (old is not None and |
| - (fixed(old['type'], old['name']) or fixed(parts['type'], parts['name']) or |
| + (fixed(old['type'], old['name'], module_prefix(previous, old), groups) or |
| + fixed(parts['type'], parts['name'], prefix, groups) or |
| old['type'] in {'aws_eip', 'aws_autoscaling_group'} or |
| parts['type'] in {'aws_eip', 'aws_autoscaling_group'}) and |
| (old['type'], old['name']) != (parts['type'], parts['name'])): |
| @@ -234,10 +327,11 @@ def strings(value): |
| yield from strings(child) |
| -def fixed_identities(resources): |
| +def fixed_identities(resources, groups): |
| identities = set() |
| - for _, kind, name, values in resources: |
| - if not fixed(kind, name): |
| + for address, kind, name, values in resources: |
| + parts = address_parts(address) |
| + if not fixed(kind, name, parts and module_prefix(address, parts), groups): |
| continue |
| keys = [] |
| if kind == 'aws_instance': |
| @@ -253,7 +347,7 @@ def fixed_identities(resources): |
| return identities |
| -def cleanup_entries(manifest, rows): |
| +def cleanup_entries(manifest, rows, groups): |
| if manifest is None: |
| return set() |
| if (not isinstance(manifest, dict) or |
| @@ -265,6 +359,7 @@ def cleanup_entries(manifest, rows): |
| # IDs, filled in after that apply, bind cleanup to those exact allocations. |
| creation = manifest['creation_plan'] |
| try: |
| + creation_groups = group_modules(creation, changes(creation)) |
| created = {row['address']: row for row in changes(creation)} |
| prior_eips = {row['values'].get('id') for row in state_resources(creation) |
| if row.get('type') == 'aws_eip'} |
| @@ -285,13 +380,18 @@ def cleanup_entries(manifest, rows): |
| address = entry['address'] |
| if address in disposable or address in prior_addresses or address not in current or address not in created: |
| raise Refused(MANIFEST) |
| - _, kind, name, change = parse_resource(current[address]) |
| - if (fixed(kind, name) or (kind, name) not in DISPOSABLE or |
| + _, kind, name, change = parse_resource(current[address], groups) |
| + prefix = module_prefix(address, address_parts(address)) |
| + # Group kinds need both plans to prove the same group module. |
| + group_kind = ((kind, name) in GROUP_DISPOSABLE and |
| + prefix in groups and prefix in creation_groups) |
| + if (fixed(kind, name, prefix, groups) or |
| + ((kind, name) not in DISPOSABLE and not group_kind) or |
| current[address]['mode'] != 'managed' or change['actions'] != ['delete'] or |
| unknown(change['after_unknown'])): |
| raise Refused(MANIFEST) |
| birth = created[address] |
| - _, _, _, first = parse_resource(birth) |
| + _, _, _, first = parse_resource(birth, creation_groups) |
| if (birth['mode'] != 'managed' or first['actions'] != ['create'] or |
| 'previous_address' in birth): |
| raise Refused(MANIFEST) |
| @@ -363,9 +463,10 @@ def group_role_provenance(document, parsed, address, kind, change, paths, identi |
| def check(document, entries, manifest): |
| rows = changes(document) |
| - parsed = [parse_resource(row) for row in rows] |
| + groups = group_modules(document, rows) |
| + parsed = [parse_resource(row, groups) for row in rows] |
| entries = allow_entries(entries) |
| - disposable = cleanup_entries(manifest, rows) |
| + disposable = cleanup_entries(manifest, rows, groups) |
| existing = [(address, kind, name, change['before']) |
| for row, (address, kind, name, change) in zip(rows, parsed) |
| if row['mode'] == 'managed' and change['before'] is not None] |
| @@ -376,8 +477,8 @@ def check(document, entries, manifest): |
| parts = address_parts(address) |
| if parts is None or not isinstance(name, str): |
| raise Refused(UNKNOWN % address) |
| - if fixed(kind, name) and kind not in RULES: |
| - fixed_modules.add(address[:parts.start('type')]) |
| + if fixed(kind, name, module_prefix(address, parts), groups) and kind not in RULES: |
| + fixed_modules.add(module_prefix(address, parts)) |
| created = {address for address, _, _, change in parsed |
| if change['actions'] == ['create']} |
| existing_addresses = {address for address, _, _, _ in existing} |
| @@ -388,7 +489,7 @@ def check(document, entries, manifest): |
| planned += [(address, kind, name, change['after']) |
| for row, (address, kind, name, change) in zip(rows, parsed) |
| if row['mode'] == 'managed' and change['before'] is not None and change['after'] is not None] |
| - identities = fixed_identities(existing + planned) |
| + identities = fixed_identities(existing + planned, groups) |
| for row, (address, kind, name, change) in zip(rows, parsed): |
| if row['mode'] == 'data': |
| continue |
| @@ -406,14 +507,15 @@ def check(document, entries, manifest): |
| if not sg or unknown(change['after_unknown']): |
| raise Refused(FIXED % (address, 'create')) |
| parts = address_parts(address) |
| - same_module = address[:parts.start('type')] in fixed_modules |
| + prefix = module_prefix(address, parts) |
| + same_module = prefix in fixed_modules |
| related = any(value in identities for value in strings([before, after])) |
| if kind == 'aws_lb_target_group_attachment' and actions in [['create'], ['delete']]: |
| related = False |
| if unknown(change['after_unknown']) and (kind == 'aws_eip_association' or |
| kind in HOST_IAM and same_module): |
| related = True |
| - is_fixed = fixed(kind, name) or related |
| + is_fixed = fixed(kind, name, prefix, groups) or related |
| if before is None: |
| if related or is_fixed and same_module: |
| raise Refused(FIXED % (address, '/'.join(actions))) |
diff --git a/scripts/check_region_group_plan_test.py b/scripts/check_region_group_plan_test.py| index 75d8f4e6a..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 |
| @@ -460,5 +461,337 @@ class GateTests(unittest.TestCase): |
| self.assertEqual(2, result.returncode) |
| +GROUP = 'module.host_ie_group.' |
| +FIXED_MODULE = 'module.host_ie.' |
| + |
| + |
| +def group_manifest(document, creation, addresses=None): |
| + addresses = addresses or [row['address'] for row in document['resource_changes']] |
| + return dict(purpose='Remove the failed group apply', approval='review-123', |
| + resources=[dict(address=a) for a in addresses], creation_plan=creation) |
| + |
| + |
| +def state_children(document, section): |
| + root = document[section]['values' if section == 'prior_state' else 'root_module'] |
| + return (root if section == 'planned_values' else root['root_module'])['child_modules'] |
| + |
| + |
| +class GroupModuleTests(unittest.TestCase): |
| + fixture = GateTests.fixture |
| + gate = GateTests.gate |
| + |
| + def box(self, address='module.host_ie_group.aws_instance.host[0]'): |
| + return dict(address=address, mode='managed', type='aws_instance', name='host', index=0, |
| + 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') |
| + rows = document['resource_changes'] |
| + self.assertEqual(18, len(rows)) |
| + self.assertEqual({'delete'}, {a for row in rows for a in row['change']['actions']}) |
| + self.assertTrue(all(row['address'].startswith(GROUP) for row in rows)) |
| + self.assertEqual(sorted([('aws_iam_role_policy', 6), ('aws_iam_role', 1), |
| + ('aws_iam_instance_profile', 1), ('aws_iam_role_policy_attachment', 1), |
| + ('aws_sqs_queue', 1), ('aws_sqs_queue_policy', 1), |
| + ('aws_cloudwatch_event_rule', 1), ('aws_cloudwatch_event_target', 1), |
| + ('aws_ssm_parameter', 2), ('aws_sns_topic', 1), |
| + ('aws_sns_topic_subscription', 1), ('aws_security_group', 1)]), |
| + sorted((k, [r['type'] for r in rows].count(k)) for k in {r['type'] for r in rows})) |
| + self.assertIn('before_identity', rows[0]['change']) |
| + self.assertIn('checked 18 resources', self.gate(document, 0).stdout) |
| + creation = self.fixture('tofu-1.12-group-create.json') |
| + self.gate(creation, 0) |
| + self.gate(document, 0, cleanup=group_manifest(document, creation)) |
| + |
| + def test_full_destroy_needs_manifest_for_group(self): |
| + document = self.fixture('tofu-1.12-group-full-destroy.json') |
| + creation = self.fixture('tofu-1.12-group-create.json') |
| + self.assertIn('would decrease', self.gate(document, 1).stderr) |
| + asg = [GROUP + 'aws_autoscaling_group.group[0]', GROUP + 'aws_launch_template.group[0]'] |
| + self.gate(document, 0, cleanup=group_manifest(document, creation, asg)) |
| + self.gate(document, 0, cleanup=group_manifest(document, creation)) |
| + |
| + def test_fixed_module_iam_keeps_original_rules(self): |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + fixed = {r['address']: r for r in state_children(document, 'prior_state')[0]['resources']} |
| + policy = fixed[FIXED_MODULE + 'aws_iam_role_policy.host_metrics'] |
| + profile = fixed[FIXED_MODULE + 'aws_iam_instance_profile.host'] |
| + role = document['resource_changes'][0] |
| + self.assertEqual(GROUP + 'aws_iam_role.host', role['address']) |
| + for name, row, expected in [ |
| + ('fixed policy update', resource(policy['address'], policy['type'], policy['name'], |
| + policy['values'], dict(policy['values'], policy='{}')), 1), |
| + ('fixed profile delete', resource(profile['address'], profile['type'], profile['name'], |
| + profile['values'], None, actions=['delete']), 1), |
| + ('group role update', resource(role['address'], 'aws_iam_role', 'host', |
| + role['change']['before'], dict(role['change']['before'], description='group')), 0)]: |
| + with self.subTest(name): |
| + bad = copy.deepcopy(document) |
| + bad['resource_changes'] = [row] |
| + result = self.gate(bad, expected) |
| + if expected: |
| + self.assertIn('fixed box resources cannot be changed', result.stderr) |
| + |
| + def test_unproven_group_module_keeps_original_rules(self): |
| + call = ['configuration', 'root_module', 'module_calls', 'host_ie_group'] |
| + |
| + def at(document, path): |
| + for key in path: |
| + document = document[key] |
| + return document |
| + mutations = { |
| + 'no configuration': lambda d: d.pop('configuration'), |
| + 'no mode': lambda d: at(d, call + ['expressions']).pop('mode'), |
| + 'mode from a variable': lambda d: at(d, call + ['expressions']).update( |
| + mode={'references': ['var.mode']}), |
| + 'mode constant fixed': lambda d: at(d, call + ['expressions']).update( |
| + mode={'constant_value': 'fixed'}), |
| + 'mode with extra keys': lambda d: at(d, call + ['expressions']).update( |
| + mode={'constant_value': 'group', 'references': []}), |
| + 'count on the call': lambda d: at(d, call).update(count_expression={'constant_value': 1}), |
| + 'for_each on the call': lambda d: at(d, call).update( |
| + for_each_expression={'constant_value': {'a': 1}}), |
| + 'box in prior_state': lambda d: state_children(d, 'prior_state')[1]['resources'].append(self.box()), |
| + 'box in planned_values': lambda d: state_children(d, 'planned_values').append( |
| + {'address': 'module.host_ie_group', 'resources': [self.box()]}), |
| + 'box in resource_changes': lambda d: d['resource_changes'].append(resource( |
| + GROUP + 'aws_instance.host[0]', before={'id': 'i-0hidden1'}, after={'id': 'i-0hidden1'}, |
| + actions=['no-op'])), |
| + 'box in resource_drift': lambda d: d.update(resource_drift=[resource( |
| + GROUP + 'aws_instance.host[0]', before={'id': 'i-0hidden1'}, after={'id': 'i-0hidden1'})]), |
| + 'box moved out of the group': lambda d: d['resource_changes'].append(resource( |
| + 'module.elsewhere.aws_instance.host', before={'id': 'i-0hidden1'}, after={'id': 'i-0hidden1'}, |
| + actions=['no-op'], previous_address=GROUP + 'aws_instance.host')), |
| + 'box in a nested child': lambda d: state_children(d, 'prior_state')[1].setdefault( |
| + 'child_modules', []).append({'address': GROUP + 'module.child', |
| + 'resources': [self.box(GROUP + 'module.child.aws_instance.x')]}), |
| + 'box in an indexed instance of the call': lambda d: state_children(d, 'prior_state').append( |
| + {'address': 'module.host_ie_group["b"]', |
| + 'resources': [self.box('module.host_ie_group["b"].aws_instance.host[0]')]}), |
| + 'box in an indexed nested child': lambda d: state_children(d, 'prior_state')[1].setdefault( |
| + 'child_modules', []).append({'address': GROUP + 'module.group_ingress[0]', |
| + 'resources': [self.box(GROUP + 'module.group_ingress[0].aws_instance.x')]}), |
| + } |
| + for name, mutate in mutations.items(): |
| + with self.subTest(name): |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + mutate(document) |
| + self.assertIn('fixed box resources cannot be changed', self.gate(document, 1).stderr) |
| + |
| + def test_indexed_group_call_is_not_proven(self): |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + text = json.dumps(document).replace('"module.host_ie_group', '"module.host_ie_group[0]') |
| + document = json.loads(text) |
| + document['configuration']['root_module']['module_calls']['host_ie_group']['count_expression'] = { |
| + 'constant_value': 1} |
| + self.gate(document, 1) |
| + del document['configuration']['root_module']['module_calls']['host_ie_group']['count_expression'] |
| + self.gate(document, 1) |
| + |
| + def test_module_boundaries(self): |
| + # A box in a module whose name merely starts with the group's does not count. |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + state_children(document, 'prior_state').append( |
| + {'address': 'module.host_ie_group_b', 'resources': [self.box('module.host_ie_group_b.aws_instance.host[0]')]}) |
| + self.gate(document, 0) |
| + # Nested calls resolve exactly: outer (fixed) holds inner (group). |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + text = json.dumps(document).replace('"module.host_ie_group', '"module.outer.module.host_ie_group') |
| + document = json.loads(text) |
| + calls = document['configuration']['root_module']['module_calls'] |
| + inner = calls.pop('host_ie_group') |
| + calls['outer'] = {'source': './outer', 'expressions': {}, 'module': {'module_calls': {'host_ie_group': inner}}} |
| + self.gate(document, 0) |
| + for mutation in ['inner at root only', 'mode on outer only', 'count on outer']: |
| + with self.subTest(mutation): |
| + bad = copy.deepcopy(document) |
| + calls = bad['configuration']['root_module']['module_calls'] |
| + if mutation == 'inner at root only': |
| + calls['host_ie_group'] = calls['outer']['module']['module_calls'].pop('host_ie_group') |
| + elif mutation == 'mode on outer only': |
| + calls['outer']['expressions']['mode'] = {'constant_value': 'group'} |
| + del calls['outer']['module']['module_calls']['host_ie_group']['expressions']['mode'] |
| + else: |
| + calls['outer']['count_expression'] = {'constant_value': 1} |
| + self.gate(bad, 1) |
| + # A fixed child module is never exempt through its group parent. |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + group_call = document['configuration']['root_module']['module_calls']['host_ie_group'] |
| + group_call['module']['module_calls']['fixed_child'] = {'source': './child', 'expressions': {}, |
| + 'module': {'resources': []}} |
| + child = GROUP + 'module.fixed_child.' |
| + for kind, name in [('aws_iam_role_policy', 'host_metrics'), ('aws_iam_instance_profile', 'host'), |
| + ('aws_iam_role', 'host')]: |
| + with self.subTest(child=kind): |
| + bad = copy.deepcopy(document) |
| + bad['resource_changes'] = [resource(child + f'{kind}.{name}', kind, name, |
| + {'id': 'child', 'name': 'child'}, None, actions=['delete'])] |
| + self.gate(bad, 1) |
| + # The group's own nested ingress call is indexed and keeps original rules. |
| + bad = copy.deepcopy(document) |
| + bad['resource_changes'] = [resource(GROUP + 'module.group_ingress[0].aws_iam_role.host', 'aws_iam_role', |
| + 'host', {'name': 'x'}, None, actions=['delete'])] |
| + self.gate(bad, 1) |
| + |
| + def test_fixed_identity_relations_still_refuse(self): |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + creation = self.fixture('tofu-1.12-group-create.json') |
| + rows = {row['address']: row for row in document['resource_changes']} |
| + for address, field, value in [ |
| + (GROUP + 'aws_iam_role_policy.host_metrics', 'role', 'carlos-dev-ie'), |
| + (GROUP + 'aws_iam_instance_profile.host', 'role', 'carlos-dev-ie'), |
| + (GROUP + 'aws_security_group.group[0]', 'id', 'sg-0fixed1'), |
| + (GROUP + 'aws_sqs_queue_policy.terminations', 'policy', 'i-0fixed1')]: |
| + for manifest in [False, True]: |
| + with self.subTest(address=address, manifest=manifest): |
| + bad = copy.deepcopy(document) |
| + row = next(r for r in bad['resource_changes'] if r['address'] == address) |
| + row['change']['before'][field] = value |
| + cleanup = group_manifest(bad, creation, [address]) if manifest else None |
| + self.gate(bad, 1, cleanup=cleanup) |
| + # A group update that points a policy at the fixed role is refused too. |
| + role = rows[GROUP + 'aws_iam_role_policy.host_metrics'] |
| + before = role['change']['before'] |
| + bad = copy.deepcopy(document) |
| + bad['resource_changes'] = [resource(role['address'], role['type'], role['name'], |
| + before, dict(before, role='carlos-dev-ie'))] |
| + self.gate(bad, 1) |
| + |
| + def test_moves_across_the_group_boundary_are_refused(self): |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + for old, new in [(FIXED_MODULE + 'aws_iam_role.host', GROUP + 'aws_iam_role.host'), |
| + (GROUP + 'aws_iam_role.host', 'module.other.aws_iam_role.host'), |
| + (GROUP + 'aws_sqs_queue.terminations', 'module.other.aws_sqs_queue.terminations')]: |
| + with self.subTest(old=old, new=new): |
| + bad = copy.deepcopy(document) |
| + parts = new.rsplit('.', 2) |
| + values = {'name': 'carlos-dev-ie-group'} |
| + bad['resource_changes'] = [resource(new, parts[1], parts[2], values, values, |
| + actions=['no-op'], previous_address=old)] |
| + self.assertIn('fixed box resources cannot be changed', self.gate(bad, 1).stderr) |
| + # Index-only moves inside the group stay readable. |
| + bad = copy.deepcopy(document) |
| + values = {'name': 'carlos-dev-ie-group'} |
| + bad['resource_changes'] = [resource(GROUP + 'aws_sqs_queue.terminations', 'aws_sqs_queue', 'terminations', |
| + values, values, actions=['no-op'], |
| + previous_address=GROUP + 'aws_sqs_queue.terminations[0]')] |
| + self.gate(bad, 0) |
| + |
| + def test_group_manifest_refusals(self): |
| + document = self.fixture('tofu-1.12-group-partial-destroy.json') |
| + creation = self.fixture('tofu-1.12-group-create.json') |
| + queue = GROUP + 'aws_sqs_queue.terminations' |
| + self.gate(document, 0, cleanup=group_manifest(document, creation, [queue])) |
| + fixed_row = resource(FIXED_MODULE + 'aws_iam_role.host', 'aws_iam_role', 'host', |
| + {'name': 'carlos-dev-ie'}, None, actions=['delete']) |
| + cases = {} |
| + bad = copy.deepcopy(document) |
| + bad['resource_changes'].append(fixed_row) |
| + born = copy.deepcopy(creation) |
| + born['resource_changes'].append(resource(fixed_row['address'], 'aws_iam_role', 'host', None, |
| + {'name': 'carlos-dev-ie'}, actions=['create'])) |
| + born['prior_state']['values']['root_module']['child_modules'][0]['resources'] = [ |
| + r for r in state_children(born, 'prior_state')[0]['resources'] if r['address'] != fixed_row['address']] |
| + cases['fixed entry'] = (bad, group_manifest(bad, born, [fixed_row['address']])) |
| + bad = copy.deepcopy(creation) |
| + bad['resource_changes'] = [r for r in bad['resource_changes'] if r['address'] != queue] |
| + cases['not created'] = (document, group_manifest(document, bad, [queue])) |
| + bad = copy.deepcopy(creation) |
| + del bad['configuration']['root_module']['module_calls']['host_ie_group']['expressions']['mode'] |
| + cases['creation plan unproven'] = (document, group_manifest(document, bad, [queue])) |
| + bad = copy.deepcopy(creation) |
| + state_children(bad, 'prior_state').append({'address': 'module.host_ie_group', 'resources': [self.box()]}) |
| + cases['creation plan holds a box'] = (document, group_manifest(document, bad, [queue])) |
| + bad = copy.deepcopy(creation) |
| + next(r for r in bad['resource_changes'] if r['address'] == queue)['change'].update( |
| + actions=['no-op'], before={'name': 'x'}, after={'name': 'x'}, after_unknown={}) |
| + cases['pre-existing'] = (document, group_manifest(document, bad, [queue])) |
| + current = copy.deepcopy(document) |
| + next(r for r in current['resource_changes'] if r['address'] == queue)['change'].update( |
| + actions=['update'], after={'name': 'x'}) |
| + cases['not a delete'] = (current, group_manifest(current, creation, [queue])) |
| + # A group kind outside any group module is not admitted. |
| + root = 'aws_sqs_queue.terminations' |
| + current = plan(resource(root, 'aws_sqs_queue', 'terminations', {'name': 'x'}, None, actions=['delete'])) |
| + birth = plan(resource(root, 'aws_sqs_queue', 'terminations', None, {'name': 'x'}, actions=['create'])) |
| + cases['root module'] = (current, group_manifest(current, birth, [root])) |
| + bad = copy.deepcopy(document) |
| + bad['resource_changes'].append(resource('module.host_ie_group.aws_cloudwatch_metric_alarm.unlisted', |
| + 'aws_cloudwatch_metric_alarm', 'unlisted', {'alarm_name': 'x'}, None, actions=['delete'])) |
| + born = copy.deepcopy(creation) |
| + born['resource_changes'].append(resource(bad['resource_changes'][-1]['address'], |
| + 'aws_cloudwatch_metric_alarm', 'unlisted', None, {'alarm_name': 'x'}, actions=['create'])) |
| + cases['unlisted kind'] = (bad, group_manifest(bad, born, [bad['resource_changes'][-1]['address']])) |
| + for name, (current, manifest) in cases.items(): |
| + with self.subTest(name): |
| + result = self.gate(current, 1, cleanup=manifest) |
| + self.assertIn('cleanup manifest', result.stderr) |
| + |
| + |
| if __name__ == '__main__': |
| unittest.main() |
diff --git a/scripts/region_group_contract_test.py b/scripts/region_group_contract_test.py| index 7e14af4c1..4b4a6afdc 100644 |
| --- a/scripts/region_group_contract_test.py |
| +++ b/scripts/region_group_contract_test.py |
| @@ -6,11 +6,13 @@ Task 2 base commit using fixed_state_unchanged, with the same mock region. |
| import ast |
| import re |
| import base64 |
| +import gzip |
| import fnmatch |
| import json |
| from pathlib import Path |
| import subprocess |
| import sys |
| +import unittest |
| def seq(value): |
| @@ -213,7 +215,7 @@ def audit_group(plan, dns): |
| assert allowed(statements, 'route53:ChangeResourceRecordSets', 'arn:aws:route53:::hostedzone/ZTESTDNS', ctx) |
| assert not allowed(statements, 'route53:ChangeResourceRecordSets', 'arn:aws:route53:::hostedzone/ZFOREIGN', ctx) |
| assert not allowed(statements, 'route53:ChangeResourceRecordSets', 'arn:aws:route53:::hostedzone/ZTESTDNS', dict(ctx, **{'route53:ChangeResourceRecordSetsRecordTypes': ['A']})) |
| - script = base64.b64decode(resources['aws_launch_template.group[0]']['user_data']).decode() |
| + script = gzip.decompress(base64.b64decode(resources['aws_launch_template.group[0]']['user_data'])).decode() |
| subprocess.run(['sh', '-n'], input=script, text=True, check=True) |
| for label, block in re.findall(r"python3 - <<'(PY[A-Z]*)'\n(.*?)\n\1", script, re.S): |
| ast.parse(block) |
| @@ -238,9 +240,23 @@ def main(path): |
| assert actual == expected, 'fixed resource attributes changed from Task 2 base' |
| print('fixed_state_unchanged: every managed resource attribute matches the original plan') |
| seen.add(run) |
| + elif run == 'real_dev_user_data': |
| + resources = {r['address']: r['values'] for r in plan['planned_values']['root_module']['resources']} |
| + encoded = resources['aws_launch_template.group[0]']['user_data'] |
| + config = json.loads((Path(__file__).parent / 'testdata/region-group-plan/dev-boot-config.json').read_text()) |
| + template = (Path(__file__).parents[1] / 'infra/modules/region-host/group-init.sh.tftpl').read_text() |
| + loop = '%{ for key, value in config ~}\n${key}=${value}\nexport ${key}\n%{ endfor ~}\n' |
| + assert template.count(loop) == 1 |
| + assignments = ''.join(key + "='" + value.replace("'", "'\"'\"'") + "'\nexport " + key + "\n" |
| + for key, value in sorted(config.items())) |
| + plain = template.replace(loop, assignments).replace('$${', '${').replace('%%{', '%{').encode() |
| + assert gzip.decompress(base64.b64decode(encoded)) == plain |
| + assert len(encoded) <= 13107 |
| + print(f'real dev user data: plain={len(plain)}, old base64={len(base64.b64encode(plain))}, gzip+base64={len(encoded)}; exact bytes match') |
| + seen.add(run) |
| elif run == 'group_boot_quotes': |
| resources = {r['address']: r['values'] for r in plan['planned_values']['root_module']['resources']} |
| - script = base64.b64decode(resources['aws_launch_template.group[0]']['user_data']).decode() |
| + script = gzip.decompress(base64.b64decode(resources['aws_launch_template.group[0]']['user_data'])).decode() |
| script = script.split('# TASK 3:', 1)[0] + '\nprintf \'%s\' "$CARLOS_TERMINATION_QUEUE_URL"' |
| result = subprocess.run(['sh'], input=script, text=True, capture_output=True, check=True) |
| assert result.stdout == resources['aws_sqs_queue.terminations']['id'], result.stdout |
| @@ -249,7 +265,41 @@ def main(path): |
| elif run in {'group_iam_exact_scope', 'group_dns_duties_enabled'}: |
| audit_group(plan, run == 'group_dns_duties_enabled') |
| seen.add(run) |
| - assert seen == {'fixed_state_unchanged', 'group_iam_exact_scope', 'group_dns_duties_enabled', 'group_boot_quotes'}, seen |
| + assert seen == {'fixed_state_unchanged', 'group_iam_exact_scope', 'group_dns_duties_enabled', 'group_boot_quotes', 'real_dev_user_data'}, seen |
| + |
| + |
| +class ContractTests(unittest.TestCase): |
| + def test_ssm_core_inheritance_and_explicit_deny(self): |
| + resource = 'arn:aws:ssm:eu-west-1:123456789012:parameter/carlos/release-key' |
| + statements = [{'Effect': 'Allow', 'Action': sorted(SSM_CORE), 'Resource': '*'}] |
| + self.assertTrue(allowed(statements, 'ssm:GetParameter', resource)) |
| + statements.append({'Effect': 'Deny', 'Action': 'ssm:GetParameter*', 'Resource': resource}) |
| + self.assertFalse(allowed(statements, 'ssm:GetParameter', resource)) |
| + |
| + def test_conditioned_deny_and_notresource(self): |
| + statements = [ |
| + {'Effect': 'Allow', 'Action': 'ssm:GetParameter', 'Resource': '*'}, |
| + {'Effect': 'Deny', 'Action': 'ssm:GetParameter', |
| + 'NotResource': ['regional', 'shared']}, |
| + ] |
| + self.assertTrue(allowed(statements, 'ssm:GetParameter', 'regional')) |
| + self.assertFalse(allowed(statements, 'ssm:GetParameter', 'foreign')) |
| + statements = [{'Effect': 'Allow', 'Action': 'kms:Decrypt', 'Resource': 'key', |
| + 'Condition': {'StringEquals': {'kms:ViaService': 'ssm.eu-west-1.amazonaws.com'}}}] |
| + self.assertFalse(allowed(statements, 'kms:Decrypt', 'key')) |
| + self.assertTrue(allowed(statements, 'kms:Decrypt', 'key', |
| + {'kms:ViaService': 'ssm.eu-west-1.amazonaws.com'})) |
| + |
| + def test_boot_template_syntax(self): |
| + template = (Path(__file__).parents[1] / 'infra/modules/region-host/group-init.sh.tftpl').read_text() |
| + script = re.sub(r'%\{ for key, value in config ~}.*?%\{ endfor ~}\n', '', template, flags=re.S) |
| + script = script.replace('$${', '${') |
| + subprocess.run(['sh', '-n'], input=script, text=True, check=True) |
| + blocks = re.findall(r"python3 - <<'(PY[A-Z]*)'\n(.*?)\n\1", script, re.S) |
| + self.assertTrue(blocks) |
| + for label, block in blocks: |
| + with self.subTest(label=label): |
| + ast.parse(block) |
| if __name__ == '__main__': |
diff --git a/scripts/testdata/region-group-plan/dev-boot-config.json b/scripts/testdata/region-group-plan/dev-boot-config.json| new file mode 100644 |
| index 000000000..1f445d4a9 |
| --- /dev/null |
| +++ b/scripts/testdata/region-group-plan/dev-boot-config.json |
| @@ -0,0 +1,17 @@ |
| +{ |
| + "AWS_REGION": "eu-west-1", |
| + "CARLOS_BOOTSTRAP_HASH_KEY": "/carlos/dev/ie/boot/bootstrap-sha256", |
| + "CARLOS_BOOTSTRAP_OBJECT_KEY": "/carlos/dev/ie/boot/bootstrap-object", |
| + "CARLOS_DEPLOYMENT": "dev", |
| + "CARLOS_DEPLOYMENT_BUCKET": "carlos-dev-640012953448", |
| + "CARLOS_GROUP_ACCOUNT": "640012953448", |
| + "CARLOS_GROUP_DATA_BUCKET": "carlos-dev-ie-640012953448", |
| + "CARLOS_GROUP_NAME": "carlos-dev-ie-group", |
| + "CARLOS_INGRESS_KEY": "/carlos/dev/ie/boot/ingress", |
| + "CARLOS_LAUNCH_HOOK_NAME": "carlos-initial-launch", |
| + "CARLOS_PLACEMENT_REGION": "", |
| + "CARLOS_POOLS": "hapair", |
| + "CARLOS_REGION": "ie", |
| + "CARLOS_RELEASE": "v0.34.2", |
| + "CARLOS_TERMINATION_QUEUE_URL": "https://sqs.eu-west-1.amazonaws.com/640012953448/carlos-dev-ie-group-terminations" |
| +} |
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" |
| + } |
| + } |
| + } |
| + ] |
| +} |
diff --git a/scripts/testdata/region-group-plan/tofu-1.12-group-create.json b/scripts/testdata/region-group-plan/tofu-1.12-group-create.json| new file mode 100644 |
| index 000000000..a4f9e0b86 |
| --- /dev/null |
| +++ b/scripts/testdata/region-group-plan/tofu-1.12-group-create.json |
| @@ -0,0 +1,1740 @@ |
| +{ |
| + "configuration": { |
| + "provider_config": { |
| + "aws": { |
| + "expressions": { |
| + "profile": { |
| + "constant_value": "example" |
| + }, |
| + "region": { |
| + "constant_value": "eu-west-1" |
| + } |
| + }, |
| + "full_name": "registry.opentofu.org/hashicorp/aws", |
| + "name": "aws" |
| + } |
| + }, |
| + "root_module": { |
| + "module_calls": { |
| + "host_ie": { |
| + "expressions": { |
| + "iam_name": { |
| + "constant_value": "carlos-dev-ie" |
| + }, |
| + "instance_type": { |
| + "constant_value": "t4g.small" |
| + }, |
| + "name": { |
| + "constant_value": "carlos-dev-ie" |
| + } |
| + }, |
| + "module": { |
| + "resources": [ |
| + { |
| + "address": "aws_instance.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_instance" |
| + }, |
| + { |
| + "address": "aws_iam_role.host", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "aws_iam_instance_profile.host", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.name", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_metrics", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_security_group.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "aws_eip.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_eip" |
| + } |
| + ], |
| + "variables": { |
| + "mode": { |
| + "default": "fixed" |
| + } |
| + } |
| + }, |
| + "source": "git::https://example.com/platform.git//infra/modules/region-host?ref=bb8973d1" |
| + }, |
| + "host_ie_group": { |
| + "expressions": { |
| + "alerts_email": { |
| + "constant_value": "alerts@example.com" |
| + }, |
| + "box_count": { |
| + "constant_value": 2 |
| + }, |
| + "iam_name": { |
| + "constant_value": "carlos-dev-ie-group" |
| + }, |
| + "mode": { |
| + "constant_value": "group" |
| + }, |
| + "name": { |
| + "constant_value": "carlos-dev-ie-group" |
| + } |
| + }, |
| + "module": { |
| + "module_calls": { |
| + "group_ingress": { |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled", |
| + "var.group_ingress" |
| + ] |
| + }, |
| + "expressions": { |
| + "name": { |
| + "references": [ |
| + "var.name" |
| + ] |
| + } |
| + }, |
| + "module": { |
| + "resources": [] |
| + }, |
| + "source": "./ingress" |
| + } |
| + }, |
| + "resources": [ |
| + { |
| + "address": "aws_iam_role.host", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "aws_iam_instance_profile.host", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.name", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy_attachment.host_ssm", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_ssm", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy_attachment" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_buckets", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_buckets", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_metrics", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_ssm_parameter_scope", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_release_key_deny", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_release_key_deny", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_terminations", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_sqs_queue.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sqs_queue" |
| + }, |
| + { |
| + "address": "aws_sqs_queue_policy.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sqs_queue_policy" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_rule.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_rule" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_target.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_target" |
| + }, |
| + { |
| + "address": "aws_ssm_parameter.group_queue", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_queue", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "aws_ssm_parameter.group_ingress", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_ingress", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "aws_sns_topic.alerts", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "alerts", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sns_topic" |
| + }, |
| + { |
| + "address": "aws_sns_topic_subscription.alerts_email", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "alerts_email", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sns_topic_subscription" |
| + }, |
| + { |
| + "address": "aws_security_group.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "aws_launch_template.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_launch_template" |
| + }, |
| + { |
| + "address": "aws_autoscaling_group.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_autoscaling_group" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_metric_alarm.group_capacity", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_capacity", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_metric_alarm" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_rule.group_launch_failed", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_launch_failed", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_rule" |
| + } |
| + ], |
| + "variables": { |
| + "mode": { |
| + "default": "fixed" |
| + } |
| + } |
| + }, |
| + "source": "git::https://example.com/platform.git//infra/modules/region-host?ref=2914921c" |
| + } |
| + } |
| + } |
| + }, |
| + "errored": false, |
| + "format_version": "1.2", |
| + "planned_values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_instance.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_instance", |
| + "values": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_eip", |
| + "values": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + } |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + }, |
| + "prior_state": { |
| + "format_version": "1.0", |
| + "terraform_version": "1.12.5", |
| + "values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_instance.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_instance", |
| + "values": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_eip", |
| + "values": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + } |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + } |
| + }, |
| + "resource_changes": [ |
| + { |
| + "address": "module.host_ie.aws_instance.host[0]", |
| + "change": { |
| + "actions": [ |
| + "no-op" |
| + ], |
| + "after": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + }, |
| + "after_identity": { |
| + "account_id": "111122223333", |
| + "id": "i-0fixed1", |
| + "region": "eu-west-1" |
| + }, |
| + "after_sensitive": { |
| + "vpc_security_group_ids": [] |
| + }, |
| + "after_unknown": {}, |
| + "before": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "id": "i-0fixed1", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "vpc_security_group_ids": [] |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_instance" |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "change": { |
| + "actions": [ |
| + "no-op" |
| + ], |
| + "after": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + }, |
| + "after_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie" |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_instance_profile.host", |
| + "change": { |
| + "actions": [ |
| + "no-op" |
| + ], |
| + "after": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role_policy.host_metrics", |
| + "change": { |
| + "actions": [ |
| + "no-op" |
| + ], |
| + "after": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + }, |
| + "after_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-metrics", |
| + "role": "carlos-dev-ie" |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-metrics", |
| + "role": "carlos-dev-ie" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "change": { |
| + "actions": [ |
| + "no-op" |
| + ], |
| + "after": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + }, |
| + "after_identity": { |
| + "account_id": "111122223333", |
| + "id": "sg-0fixed1", |
| + "region": "eu-west-1" |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "id": "sg-0fixed1", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "change": { |
| + "actions": [ |
| + "no-op" |
| + ], |
| + "after": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + }, |
| + "after_identity": { |
| + "account_id": "111122223333", |
| + "id": "eipalloc-0fixed1", |
| + "region": "eu-west-1" |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": {}, |
| + "before": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "id": "eipalloc-0fixed1", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_eip" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role.host", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "assume_role_policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"ec2.amazonaws.com\"}, \"Action\": \"sts:AssumeRole\"}]}", |
| + "description": "", |
| + "force_detach_policies": false, |
| + "max_session_duration": 3600, |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "permissions_boundary": "", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null |
| + }, |
| + "after_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "unique_id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_instance_profile.host", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "role": "carlos-dev-ie-group", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "create_date": true, |
| + "id": true, |
| + "unique_id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy_attachment.host_ssm", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "policy_arn": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "policy_arn": null, |
| + "role": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "role": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_ssm", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy_attachment" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.group[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group-group", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"s3:GetObject\", \"Resource\": \"arn:aws:s3:::carlos-dev-platform/bootstrap/dev/ie/*\"}]}" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "role": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "role": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_buckets", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group-buckets", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "role": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "role": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_buckets", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_metrics", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group-metrics", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "role": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "role": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_ssm_parameter_scope[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group-ssm-parameter-scope", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "role": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "role": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_release_key_deny[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group-release-key-deny", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "role": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "role": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_release_key_deny", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_terminations", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group-terminations", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "role": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "role": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue.terminations", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "message_retention_seconds": 86400, |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "sqs_managed_sse_enabled": true, |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "region": null, |
| + "url": null |
| + }, |
| + "after_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "url": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sqs_queue" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue_policy.terminations", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "region": "eu-west-1" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "queue_url": null, |
| + "region": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "id": true, |
| + "policy": true, |
| + "queue_url": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sqs_queue_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.terminations", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "event_bus_name": "default", |
| + "event_pattern": "{\"source\": [\"aws.ec2\"], \"detail-type\": [\"EC2 Instance State-change Notification\"]}", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "state": "ENABLED", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "event_bus_name": null, |
| + "name": null, |
| + "region": null |
| + }, |
| + "after_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_rule" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_target.terminations", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "event_bus_name": "default", |
| + "region": "eu-west-1", |
| + "rule": "carlos-dev-ie-group-terminations", |
| + "target_id": "queue" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "event_bus_name": null, |
| + "region": null, |
| + "rule": null, |
| + "target_id": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_target" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_queue[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "version": 1 |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "region": null |
| + }, |
| + "after_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "value": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_queue", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_ingress[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "/carlos/dev/ie/boot/ingress", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "version": 1 |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "name": null, |
| + "region": null |
| + }, |
| + "after_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "value": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_ingress", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic.alerts[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "name": "carlos-dev-ie-group-alerts", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_identity": { |
| + "arn": null |
| + }, |
| + "after_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "owner": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "alerts", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sns_topic" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic_subscription.alerts_email[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "endpoint": "alerts@example.com", |
| + "pending_confirmation": true, |
| + "protocol": "email", |
| + "region": "eu-west-1" |
| + }, |
| + "after_identity": { |
| + "arn": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "topic_arn": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "alerts_email", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sns_topic_subscription" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_security_group.group[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "description": "carlos dev IE group", |
| + "egress": [], |
| + "ingress": [ |
| + { |
| + "cidr_blocks": [], |
| + "description": "", |
| + "from_port": 80, |
| + "ipv6_cidr_blocks": [], |
| + "prefix_list_ids": [], |
| + "protocol": "tcp", |
| + "security_groups": [ |
| + "sg-0nlb1" |
| + ], |
| + "self": false, |
| + "to_port": 80 |
| + } |
| + ], |
| + "name": "carlos-dev-ie-group", |
| + "region": "eu-west-1", |
| + "revoke_rules_on_delete": false, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "timeouts": null, |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "id": null, |
| + "region": null |
| + }, |
| + "after_sensitive": { |
| + "egress": [], |
| + "ingress": [], |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "owner_id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_launch_template.group[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "iam_instance_profile": [ |
| + { |
| + "arn": "", |
| + "name": "carlos-dev-ie-group" |
| + } |
| + ], |
| + "image_id": "ami-0123456789abcdef0", |
| + "instance_type": "t4g.micro", |
| + "name": "carlos-dev-ie-group", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "user_data": "H4sIAAAAAAAA/0rOzytJzSvRS87PBQQAAP//", |
| + "vpc_security_group_ids": [ |
| + "sg-0group1" |
| + ] |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "id": null, |
| + "region": null |
| + }, |
| + "after_sensitive": { |
| + "iam_instance_profile": [], |
| + "tags": {}, |
| + "tags_all": {}, |
| + "vpc_security_group_ids": [] |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true, |
| + "latest_version": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_launch_template" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_autoscaling_group.group[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "desired_capacity": 2, |
| + "launch_template": [ |
| + { |
| + "id": "lt-0group1", |
| + "name": "carlos-dev-ie-group", |
| + "version": "1" |
| + } |
| + ], |
| + "max_size": 2, |
| + "min_size": 2, |
| + "name": "carlos-dev-ie-group", |
| + "region": "eu-west-1", |
| + "target_group_arns": [ |
| + "arn:aws:elasticloadbalancing:eu-west-1:111122223333:targetgroup/carlos-dev-ie-nlb-80/1234" |
| + ], |
| + "vpc_zone_identifier": [ |
| + "subnet-00000000000000001" |
| + ] |
| + }, |
| + "after_sensitive": { |
| + "launch_template": [], |
| + "target_group_arns": [], |
| + "vpc_zone_identifier": [] |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_autoscaling_group" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_metric_alarm.group_capacity[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "alarm_actions": [ |
| + "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + ], |
| + "alarm_name": "carlos-dev-ie-group-capacity", |
| + "dimensions": { |
| + "AutoScalingGroupName": "carlos-dev-ie-group" |
| + }, |
| + "region": "eu-west-1" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "alarm_name": null, |
| + "region": null |
| + }, |
| + "after_sensitive": { |
| + "alarm_actions": [], |
| + "dimensions": {} |
| + }, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_capacity", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_metric_alarm" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.group_launch_failed[0]", |
| + "change": { |
| + "actions": [ |
| + "create" |
| + ], |
| + "after": { |
| + "event_bus_name": "default", |
| + "name": "carlos-dev-ie-group-launch-failed", |
| + "region": "eu-west-1", |
| + "state": "ENABLED" |
| + }, |
| + "after_identity": { |
| + "account_id": null, |
| + "event_bus_name": null, |
| + "name": null, |
| + "region": null |
| + }, |
| + "after_sensitive": {}, |
| + "after_unknown": { |
| + "arn": true, |
| + "id": true |
| + }, |
| + "before": null, |
| + "before_sensitive": false |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_launch_failed", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_rule" |
| + } |
| + ], |
| + "terraform_version": "1.12.5", |
| + "timestamp": "2026-11-04T18:39:07Z" |
| +} |
diff --git a/scripts/testdata/region-group-plan/tofu-1.12-group-full-destroy.json b/scripts/testdata/region-group-plan/tofu-1.12-group-full-destroy.json| new file mode 100644 |
| index 000000000..7a0cfd7e5 |
| --- /dev/null |
| +++ b/scripts/testdata/region-group-plan/tofu-1.12-group-full-destroy.json |
| @@ -0,0 +1,1942 @@ |
| +{ |
| + "configuration": { |
| + "provider_config": { |
| + "aws": { |
| + "expressions": { |
| + "profile": { |
| + "constant_value": "example" |
| + }, |
| + "region": { |
| + "constant_value": "eu-west-1" |
| + } |
| + }, |
| + "full_name": "registry.opentofu.org/hashicorp/aws", |
| + "name": "aws" |
| + } |
| + }, |
| + "root_module": { |
| + "module_calls": { |
| + "host_ie": { |
| + "expressions": { |
| + "iam_name": { |
| + "constant_value": "carlos-dev-ie" |
| + }, |
| + "instance_type": { |
| + "constant_value": "t4g.small" |
| + }, |
| + "name": { |
| + "constant_value": "carlos-dev-ie" |
| + } |
| + }, |
| + "module": { |
| + "resources": [ |
| + { |
| + "address": "aws_instance.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_instance" |
| + }, |
| + { |
| + "address": "aws_iam_role.host", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "aws_iam_instance_profile.host", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.name", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_metrics", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_security_group.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "aws_eip.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_eip" |
| + } |
| + ], |
| + "variables": { |
| + "mode": { |
| + "default": "fixed" |
| + } |
| + } |
| + }, |
| + "source": "git::https://example.com/platform.git//infra/modules/region-host?ref=bb8973d1" |
| + }, |
| + "host_ie_group": { |
| + "expressions": { |
| + "alerts_email": { |
| + "constant_value": "alerts@example.com" |
| + }, |
| + "box_count": { |
| + "constant_value": 2 |
| + }, |
| + "iam_name": { |
| + "constant_value": "carlos-dev-ie-group" |
| + }, |
| + "mode": { |
| + "constant_value": "group" |
| + }, |
| + "name": { |
| + "constant_value": "carlos-dev-ie-group" |
| + } |
| + }, |
| + "module": { |
| + "module_calls": { |
| + "group_ingress": { |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled", |
| + "var.group_ingress" |
| + ] |
| + }, |
| + "expressions": { |
| + "name": { |
| + "references": [ |
| + "var.name" |
| + ] |
| + } |
| + }, |
| + "module": { |
| + "resources": [] |
| + }, |
| + "source": "./ingress" |
| + } |
| + }, |
| + "resources": [ |
| + { |
| + "address": "aws_iam_role.host", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "aws_iam_instance_profile.host", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.name", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy_attachment.host_ssm", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_ssm", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy_attachment" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_buckets", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_buckets", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_metrics", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_ssm_parameter_scope", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_release_key_deny", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_release_key_deny", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_terminations", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_sqs_queue.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sqs_queue" |
| + }, |
| + { |
| + "address": "aws_sqs_queue_policy.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sqs_queue_policy" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_rule.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_rule" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_target.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_target" |
| + }, |
| + { |
| + "address": "aws_ssm_parameter.group_queue", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_queue", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "aws_ssm_parameter.group_ingress", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_ingress", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "aws_sns_topic.alerts", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "alerts", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sns_topic" |
| + }, |
| + { |
| + "address": "aws_sns_topic_subscription.alerts_email", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "alerts_email", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sns_topic_subscription" |
| + }, |
| + { |
| + "address": "aws_security_group.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "aws_launch_template.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_launch_template" |
| + }, |
| + { |
| + "address": "aws_autoscaling_group.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_autoscaling_group" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_metric_alarm.group_capacity", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_capacity", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_metric_alarm" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_rule.group_launch_failed", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_launch_failed", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_rule" |
| + } |
| + ], |
| + "variables": { |
| + "mode": { |
| + "default": "fixed" |
| + } |
| + } |
| + }, |
| + "source": "git::https://example.com/platform.git//infra/modules/region-host?ref=2914921c" |
| + } |
| + } |
| + } |
| + }, |
| + "errored": false, |
| + "format_version": "1.2", |
| + "planned_values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_instance.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_instance", |
| + "values": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_eip", |
| + "values": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + } |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + }, |
| + "prior_state": { |
| + "format_version": "1.0", |
| + "terraform_version": "1.12.5", |
| + "values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_instance.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_instance", |
| + "values": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_eip", |
| + "values": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + } |
| + } |
| + ] |
| + }, |
| + { |
| + "address": "module.host_ie_group", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie_group.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie-group", |
| + "assume_role_policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"ec2.amazonaws.com\"}, \"Action\": \"sts:AssumeRole\"}]}", |
| + "description": "", |
| + "force_detach_policies": false, |
| + "id": "carlos-dev-ie-group", |
| + "max_session_duration": 3600, |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "permissions_boundary": "", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AROAEXAMPLEGROUP0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie-group", |
| + "create_date": "2026-11-04T18:39:20Z", |
| + "id": "carlos-dev-ie-group", |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "role": "carlos-dev-ie-group", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AIPAEXAMPLEGROUP0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy_attachment.host_ssm", |
| + "mode": "managed", |
| + "name": "host_ssm", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy_attachment", |
| + "values": { |
| + "id": "carlos-dev-ie-group/arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "policy_arn": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.group[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-group", |
| + "name": "carlos-dev-ie-group-group", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"s3:GetObject\", \"Resource\": \"arn:aws:s3:::carlos-dev-platform/bootstrap/dev/ie/*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_buckets", |
| + "mode": "managed", |
| + "name": "host_buckets", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-buckets", |
| + "name": "carlos-dev-ie-group-buckets", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-metrics", |
| + "name": "carlos-dev-ie-group-metrics", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_ssm_parameter_scope[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-ssm-parameter-scope", |
| + "name": "carlos-dev-ie-group-ssm-parameter-scope", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_release_key_deny[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host_release_key_deny", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-release-key-deny", |
| + "name": "carlos-dev-ie-group-release-key-deny", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_terminations", |
| + "mode": "managed", |
| + "name": "host_terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sqs_queue", |
| + "values": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "message_retention_seconds": 86400, |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "sqs_managed_sse_enabled": true, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue_policy.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sqs_queue_policy", |
| + "values": { |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations\"}}}]}", |
| + "queue_url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_cloudwatch_event_rule", |
| + "values": { |
| + "arn": "arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "event_pattern": "{\"source\": [\"aws.ec2\"], \"detail-type\": [\"EC2 Instance State-change Notification\"]}", |
| + "id": "carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "state": "ENABLED", |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_target.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_cloudwatch_event_target", |
| + "values": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "id": "carlos-dev-ie-group-terminations-queue", |
| + "region": "eu-west-1", |
| + "rule": "carlos-dev-ie-group-terminations", |
| + "target_id": "queue" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_queue[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group_queue", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_ssm_parameter", |
| + "values": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "id": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "name": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "version": 1 |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_ingress[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group_ingress", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_ssm_parameter", |
| + "values": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/ingress", |
| + "id": "/carlos/dev/ie/boot/ingress", |
| + "name": "/carlos/dev/ie/boot/ingress", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "{\"public_ips\": {\"eu-west-1a\": \"198.51.100.10\"}}", |
| + "version": 1 |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic.alerts[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "alerts", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sns_topic", |
| + "values": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "name": "carlos-dev-ie-group-alerts", |
| + "owner": "111122223333", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic_subscription.alerts_email[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "alerts_email", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sns_topic_subscription", |
| + "values": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "endpoint": "alerts@example.com", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "pending_confirmation": true, |
| + "protocol": "email", |
| + "region": "eu-west-1", |
| + "topic_arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_security_group.group[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "arn": "arn:aws:ec2:eu-west-1:111122223333:security-group/sg-0group1", |
| + "description": "carlos dev IE group", |
| + "egress": [], |
| + "id": "sg-0group1", |
| + "ingress": [ |
| + { |
| + "cidr_blocks": [], |
| + "description": "", |
| + "from_port": 80, |
| + "ipv6_cidr_blocks": [], |
| + "prefix_list_ids": [], |
| + "protocol": "tcp", |
| + "security_groups": [ |
| + "sg-0nlb1" |
| + ], |
| + "self": false, |
| + "to_port": 80 |
| + } |
| + ], |
| + "name": "carlos-dev-ie-group", |
| + "owner_id": "111122223333", |
| + "region": "eu-west-1", |
| + "revoke_rules_on_delete": false, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "timeouts": null, |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_launch_template.group[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_launch_template", |
| + "values": { |
| + "arn": "arn:aws:ec2:eu-west-1:111122223333:launch-template/lt-0group1", |
| + "iam_instance_profile": [ |
| + { |
| + "arn": "", |
| + "name": "carlos-dev-ie-group" |
| + } |
| + ], |
| + "id": "lt-0group1", |
| + "image_id": "ami-0123456789abcdef0", |
| + "instance_type": "t4g.micro", |
| + "latest_version": 1, |
| + "name": "carlos-dev-ie-group", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "user_data": "H4sIAAAAAAAA/0rOzytJzSvRS87PBQQAAP//", |
| + "vpc_security_group_ids": [ |
| + "sg-0group1" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_autoscaling_group.group[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_autoscaling_group", |
| + "values": { |
| + "arn": "arn:aws:autoscaling:eu-west-1:111122223333:autoScalingGroup:0:autoScalingGroupName/carlos-dev-ie-group", |
| + "desired_capacity": 2, |
| + "id": "carlos-dev-ie-group", |
| + "launch_template": [ |
| + { |
| + "id": "lt-0group1", |
| + "name": "carlos-dev-ie-group", |
| + "version": "1" |
| + } |
| + ], |
| + "max_size": 2, |
| + "min_size": 2, |
| + "name": "carlos-dev-ie-group", |
| + "region": "eu-west-1", |
| + "target_group_arns": [ |
| + "arn:aws:elasticloadbalancing:eu-west-1:111122223333:targetgroup/carlos-dev-ie-nlb-80/1234" |
| + ], |
| + "vpc_zone_identifier": [ |
| + "subnet-00000000000000001" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_metric_alarm.group_capacity[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group_capacity", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_cloudwatch_metric_alarm", |
| + "values": { |
| + "alarm_actions": [ |
| + "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + ], |
| + "alarm_name": "carlos-dev-ie-group-capacity", |
| + "arn": "arn:aws:cloudwatch:eu-west-1:111122223333:alarm:carlos-dev-ie-group-capacity", |
| + "dimensions": { |
| + "AutoScalingGroupName": "carlos-dev-ie-group" |
| + }, |
| + "id": "carlos-dev-ie-group-capacity", |
| + "region": "eu-west-1" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.group_launch_failed[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group_launch_failed", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_cloudwatch_event_rule", |
| + "values": { |
| + "arn": "arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-launch-failed", |
| + "event_bus_name": "default", |
| + "id": "carlos-dev-ie-group-launch-failed", |
| + "name": "carlos-dev-ie-group-launch-failed", |
| + "region": "eu-west-1", |
| + "state": "ENABLED" |
| + } |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + } |
| + }, |
| + "resource_changes": [ |
| + { |
| + "address": "module.host_ie_group.aws_iam_role.host", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie-group", |
| + "assume_role_policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"ec2.amazonaws.com\"}, \"Action\": \"sts:AssumeRole\"}]}", |
| + "description": "", |
| + "force_detach_policies": false, |
| + "id": "carlos-dev-ie-group", |
| + "max_session_duration": 3600, |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "permissions_boundary": "", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AROAEXAMPLEGROUP0001" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_instance_profile.host", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie-group", |
| + "create_date": "2026-11-04T18:39:20Z", |
| + "id": "carlos-dev-ie-group", |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "role": "carlos-dev-ie-group", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AIPAEXAMPLEGROUP0001" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy_attachment.host_ssm", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group/arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "policy_arn": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "policy_arn": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_ssm", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy_attachment" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.group[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-group", |
| + "name": "carlos-dev-ie-group-group", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"s3:GetObject\", \"Resource\": \"arn:aws:s3:::carlos-dev-platform/bootstrap/dev/ie/*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-group", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_buckets", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-buckets", |
| + "name": "carlos-dev-ie-group-buckets", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-buckets", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_buckets", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_metrics", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-metrics", |
| + "name": "carlos-dev-ie-group-metrics", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-metrics", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_ssm_parameter_scope[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-ssm-parameter-scope", |
| + "name": "carlos-dev-ie-group-ssm-parameter-scope", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-ssm-parameter-scope", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_release_key_deny[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-release-key-deny", |
| + "name": "carlos-dev-ie-group-release-key-deny", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-release-key-deny", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_release_key_deny", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "message_retention_seconds": 86400, |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "sqs_managed_sse_enabled": true, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "region": "eu-west-1", |
| + "url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sqs_queue" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue_policy.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations\"}}}]}", |
| + "queue_url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "queue_url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sqs_queue_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "event_pattern": "{\"source\": [\"aws.ec2\"], \"detail-type\": [\"EC2 Instance State-change Notification\"]}", |
| + "id": "carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "state": "ENABLED", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "event_bus_name": "default", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_rule" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_target.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "id": "carlos-dev-ie-group-terminations-queue", |
| + "region": "eu-west-1", |
| + "rule": "carlos-dev-ie-group-terminations", |
| + "target_id": "queue" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "event_bus_name": "default", |
| + "region": "eu-west-1", |
| + "rule": "carlos-dev-ie-group-terminations", |
| + "target_id": "queue" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_target" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_queue[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "id": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "name": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "version": 1 |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_queue", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_ingress[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/ingress", |
| + "id": "/carlos/dev/ie/boot/ingress", |
| + "name": "/carlos/dev/ie/boot/ingress", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "{\"public_ips\": {\"eu-west-1a\": \"198.51.100.10\"}}", |
| + "version": 1 |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "/carlos/dev/ie/boot/ingress", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_ingress", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic.alerts[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "name": "carlos-dev-ie-group-alerts", |
| + "owner": "111122223333", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "before_identity": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "alerts", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sns_topic" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic_subscription.alerts_email[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "endpoint": "alerts@example.com", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "pending_confirmation": true, |
| + "protocol": "email", |
| + "region": "eu-west-1", |
| + "topic_arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + }, |
| + "before_identity": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "alerts_email", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sns_topic_subscription" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_security_group.group[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:ec2:eu-west-1:111122223333:security-group/sg-0group1", |
| + "description": "carlos dev IE group", |
| + "egress": [], |
| + "id": "sg-0group1", |
| + "ingress": [ |
| + { |
| + "cidr_blocks": [], |
| + "description": "", |
| + "from_port": 80, |
| + "ipv6_cidr_blocks": [], |
| + "prefix_list_ids": [], |
| + "protocol": "tcp", |
| + "security_groups": [ |
| + "sg-0nlb1" |
| + ], |
| + "self": false, |
| + "to_port": 80 |
| + } |
| + ], |
| + "name": "carlos-dev-ie-group", |
| + "owner_id": "111122223333", |
| + "region": "eu-west-1", |
| + "revoke_rules_on_delete": false, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "timeouts": null, |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "id": "sg-0group1", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "egress": [], |
| + "ingress": [], |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_launch_template.group[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:ec2:eu-west-1:111122223333:launch-template/lt-0group1", |
| + "iam_instance_profile": [ |
| + { |
| + "arn": "", |
| + "name": "carlos-dev-ie-group" |
| + } |
| + ], |
| + "id": "lt-0group1", |
| + "image_id": "ami-0123456789abcdef0", |
| + "instance_type": "t4g.micro", |
| + "latest_version": 1, |
| + "name": "carlos-dev-ie-group", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "user_data": "H4sIAAAAAAAA/0rOzytJzSvRS87PBQQAAP//", |
| + "vpc_security_group_ids": [ |
| + "sg-0group1" |
| + ] |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "id": "lt-0group1", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "iam_instance_profile": [], |
| + "tags": {}, |
| + "tags_all": {}, |
| + "vpc_security_group_ids": [] |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_launch_template" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_autoscaling_group.group[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:autoscaling:eu-west-1:111122223333:autoScalingGroup:0:autoScalingGroupName/carlos-dev-ie-group", |
| + "desired_capacity": 2, |
| + "id": "carlos-dev-ie-group", |
| + "launch_template": [ |
| + { |
| + "id": "lt-0group1", |
| + "name": "carlos-dev-ie-group", |
| + "version": "1" |
| + } |
| + ], |
| + "max_size": 2, |
| + "min_size": 2, |
| + "name": "carlos-dev-ie-group", |
| + "region": "eu-west-1", |
| + "target_group_arns": [ |
| + "arn:aws:elasticloadbalancing:eu-west-1:111122223333:targetgroup/carlos-dev-ie-nlb-80/1234" |
| + ], |
| + "vpc_zone_identifier": [ |
| + "subnet-00000000000000001" |
| + ] |
| + }, |
| + "before_sensitive": { |
| + "launch_template": [], |
| + "target_group_arns": [], |
| + "vpc_zone_identifier": [] |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_autoscaling_group" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_metric_alarm.group_capacity[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "alarm_actions": [ |
| + "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + ], |
| + "alarm_name": "carlos-dev-ie-group-capacity", |
| + "arn": "arn:aws:cloudwatch:eu-west-1:111122223333:alarm:carlos-dev-ie-group-capacity", |
| + "dimensions": { |
| + "AutoScalingGroupName": "carlos-dev-ie-group" |
| + }, |
| + "id": "carlos-dev-ie-group-capacity", |
| + "region": "eu-west-1" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "alarm_name": "carlos-dev-ie-group-capacity", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "alarm_actions": [], |
| + "dimensions": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_capacity", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_metric_alarm" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.group_launch_failed[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-launch-failed", |
| + "event_bus_name": "default", |
| + "id": "carlos-dev-ie-group-launch-failed", |
| + "name": "carlos-dev-ie-group-launch-failed", |
| + "region": "eu-west-1", |
| + "state": "ENABLED" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "event_bus_name": "default", |
| + "name": "carlos-dev-ie-group-launch-failed", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_launch_failed", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_rule" |
| + } |
| + ], |
| + "terraform_version": "1.12.5", |
| + "timestamp": "2026-11-04T18:41:20Z" |
| +} |
diff --git a/scripts/testdata/region-group-plan/tofu-1.12-group-partial-destroy.json b/scripts/testdata/region-group-plan/tofu-1.12-group-partial-destroy.json| new file mode 100644 |
| index 000000000..f9558d5a0 |
| --- /dev/null |
| +++ b/scripts/testdata/region-group-plan/tofu-1.12-group-partial-destroy.json |
| @@ -0,0 +1,1676 @@ |
| +{ |
| + "configuration": { |
| + "provider_config": { |
| + "aws": { |
| + "expressions": { |
| + "profile": { |
| + "constant_value": "example" |
| + }, |
| + "region": { |
| + "constant_value": "eu-west-1" |
| + } |
| + }, |
| + "full_name": "registry.opentofu.org/hashicorp/aws", |
| + "name": "aws" |
| + } |
| + }, |
| + "root_module": { |
| + "module_calls": { |
| + "host_ie": { |
| + "expressions": { |
| + "iam_name": { |
| + "constant_value": "carlos-dev-ie" |
| + }, |
| + "instance_type": { |
| + "constant_value": "t4g.small" |
| + }, |
| + "name": { |
| + "constant_value": "carlos-dev-ie" |
| + } |
| + }, |
| + "module": { |
| + "resources": [ |
| + { |
| + "address": "aws_instance.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_instance" |
| + }, |
| + { |
| + "address": "aws_iam_role.host", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "aws_iam_instance_profile.host", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.name", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_metrics", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_security_group.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "aws_eip.host", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_eip" |
| + } |
| + ], |
| + "variables": { |
| + "mode": { |
| + "default": "fixed" |
| + } |
| + } |
| + }, |
| + "source": "git::https://example.com/platform.git//infra/modules/region-host?ref=bb8973d1" |
| + }, |
| + "host_ie_group": { |
| + "expressions": { |
| + "alerts_email": { |
| + "constant_value": "alerts@example.com" |
| + }, |
| + "box_count": { |
| + "constant_value": 2 |
| + }, |
| + "iam_name": { |
| + "constant_value": "carlos-dev-ie-group" |
| + }, |
| + "mode": { |
| + "constant_value": "group" |
| + }, |
| + "name": { |
| + "constant_value": "carlos-dev-ie-group" |
| + } |
| + }, |
| + "module": { |
| + "module_calls": { |
| + "group_ingress": { |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled", |
| + "var.group_ingress" |
| + ] |
| + }, |
| + "expressions": { |
| + "name": { |
| + "references": [ |
| + "var.name" |
| + ] |
| + } |
| + }, |
| + "module": { |
| + "resources": [] |
| + }, |
| + "source": "./ingress" |
| + } |
| + }, |
| + "resources": [ |
| + { |
| + "address": "aws_iam_role.host", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "aws_iam_instance_profile.host", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.name", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy_attachment.host_ssm", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_ssm", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy_attachment" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_buckets", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_buckets", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_metrics", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_ssm_parameter_scope", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_release_key_deny", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_release_key_deny", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_iam_role_policy.host_terminations", |
| + "expressions": { |
| + "role": { |
| + "references": [ |
| + "aws_iam_role.host.id", |
| + "aws_iam_role.host" |
| + ] |
| + } |
| + }, |
| + "mode": "managed", |
| + "name": "host_terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "aws_sqs_queue.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sqs_queue" |
| + }, |
| + { |
| + "address": "aws_sqs_queue_policy.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sqs_queue_policy" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_rule.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_rule" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_target.terminations", |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_target" |
| + }, |
| + { |
| + "address": "aws_ssm_parameter.group_queue", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_queue", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "aws_ssm_parameter.group_ingress", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_ingress", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "aws_sns_topic.alerts", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "alerts", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sns_topic" |
| + }, |
| + { |
| + "address": "aws_sns_topic_subscription.alerts_email", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "alerts_email", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_sns_topic_subscription" |
| + }, |
| + { |
| + "address": "aws_security_group.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_security_group" |
| + }, |
| + { |
| + "address": "aws_launch_template.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_launch_template" |
| + }, |
| + { |
| + "address": "aws_autoscaling_group.group", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_autoscaling_group" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_metric_alarm.group_capacity", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_capacity", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_metric_alarm" |
| + }, |
| + { |
| + "address": "aws_cloudwatch_event_rule.group_launch_failed", |
| + "count_expression": { |
| + "references": [ |
| + "local.group_enabled" |
| + ] |
| + }, |
| + "expressions": {}, |
| + "mode": "managed", |
| + "name": "group_launch_failed", |
| + "provider_config_key": "aws", |
| + "schema_version": 0, |
| + "type": "aws_cloudwatch_event_rule" |
| + } |
| + ], |
| + "variables": { |
| + "mode": { |
| + "default": "fixed" |
| + } |
| + } |
| + }, |
| + "source": "git::https://example.com/platform.git//infra/modules/region-host?ref=2914921c" |
| + } |
| + } |
| + } |
| + }, |
| + "errored": false, |
| + "format_version": "1.2", |
| + "planned_values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_instance.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_instance", |
| + "values": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_eip", |
| + "values": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + } |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + }, |
| + "prior_state": { |
| + "format_version": "1.0", |
| + "terraform_version": "1.12.5", |
| + "values": { |
| + "root_module": { |
| + "child_modules": [ |
| + { |
| + "address": "module.host_ie", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie.aws_instance.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_instance", |
| + "values": { |
| + "iam_instance_profile": "carlos-dev-ie", |
| + "id": "i-0fixed1", |
| + "instance_type": "t4g.small", |
| + "primary_network_interface_id": "eni-0fixed1", |
| + "region": "eu-west-1", |
| + "vpc_security_group_ids": [ |
| + "sg-0fixed1" |
| + ] |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "unique_id": "AROAEXAMPLEFIXED0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie", |
| + "id": "carlos-dev-ie", |
| + "name": "carlos-dev-ie", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie:carlos-dev-ie-metrics", |
| + "name": "carlos-dev-ie-metrics", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_security_group.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "id": "sg-0fixed1", |
| + "name": "carlos-dev-ie", |
| + "region": "eu-west-1", |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie.aws_eip.host[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_eip", |
| + "values": { |
| + "allocation_id": "eipalloc-0fixed1", |
| + "id": "eipalloc-0fixed1", |
| + "instance": "i-0fixed1", |
| + "public_ip": "192.0.2.1", |
| + "region": "eu-west-1" |
| + } |
| + } |
| + ] |
| + }, |
| + { |
| + "address": "module.host_ie_group", |
| + "resources": [ |
| + { |
| + "address": "module.host_ie_group.aws_iam_role.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie-group", |
| + "assume_role_policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"ec2.amazonaws.com\"}, \"Action\": \"sts:AssumeRole\"}]}", |
| + "description": "", |
| + "force_detach_policies": false, |
| + "id": "carlos-dev-ie-group", |
| + "max_session_duration": 3600, |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "permissions_boundary": "", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AROAEXAMPLEGROUP0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_instance_profile.host", |
| + "mode": "managed", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_instance_profile", |
| + "values": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie-group", |
| + "create_date": "2026-11-04T18:39:20Z", |
| + "id": "carlos-dev-ie-group", |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "role": "carlos-dev-ie-group", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AIPAEXAMPLEGROUP0001" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy_attachment.host_ssm", |
| + "mode": "managed", |
| + "name": "host_ssm", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy_attachment", |
| + "values": { |
| + "id": "carlos-dev-ie-group/arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "policy_arn": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.group[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-group", |
| + "name": "carlos-dev-ie-group-group", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"s3:GetObject\", \"Resource\": \"arn:aws:s3:::carlos-dev-platform/bootstrap/dev/ie/*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_buckets", |
| + "mode": "managed", |
| + "name": "host_buckets", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-buckets", |
| + "name": "carlos-dev-ie-group-buckets", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_metrics", |
| + "mode": "managed", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-metrics", |
| + "name": "carlos-dev-ie-group-metrics", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_ssm_parameter_scope[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-ssm-parameter-scope", |
| + "name": "carlos-dev-ie-group-ssm-parameter-scope", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_release_key_deny[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "host_release_key_deny", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-release-key-deny", |
| + "name": "carlos-dev-ie-group-release-key-deny", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_terminations", |
| + "mode": "managed", |
| + "name": "host_terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_iam_role_policy", |
| + "values": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sqs_queue", |
| + "values": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "message_retention_seconds": 86400, |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "sqs_managed_sse_enabled": true, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue_policy.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sqs_queue_policy", |
| + "values": { |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations\"}}}]}", |
| + "queue_url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_cloudwatch_event_rule", |
| + "values": { |
| + "arn": "arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "event_pattern": "{\"source\": [\"aws.ec2\"], \"detail-type\": [\"EC2 Instance State-change Notification\"]}", |
| + "id": "carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "state": "ENABLED", |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_target.terminations", |
| + "mode": "managed", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_cloudwatch_event_target", |
| + "values": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "id": "carlos-dev-ie-group-terminations-queue", |
| + "region": "eu-west-1", |
| + "rule": "carlos-dev-ie-group-terminations", |
| + "target_id": "queue" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_queue[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group_queue", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_ssm_parameter", |
| + "values": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "id": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "name": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "version": 1 |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_ingress[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group_ingress", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_ssm_parameter", |
| + "values": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/ingress", |
| + "id": "/carlos/dev/ie/boot/ingress", |
| + "name": "/carlos/dev/ie/boot/ingress", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "{\"public_ips\": {\"eu-west-1a\": \"198.51.100.10\"}}", |
| + "version": 1 |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic.alerts[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "alerts", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sns_topic", |
| + "values": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "name": "carlos-dev-ie-group-alerts", |
| + "owner": "111122223333", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic_subscription.alerts_email[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "alerts_email", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_sns_topic_subscription", |
| + "values": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "endpoint": "alerts@example.com", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "pending_confirmation": true, |
| + "protocol": "email", |
| + "region": "eu-west-1", |
| + "topic_arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + } |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_security_group.group[0]", |
| + "index": 0, |
| + "mode": "managed", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "schema_version": 0, |
| + "sensitive_values": {}, |
| + "type": "aws_security_group", |
| + "values": { |
| + "arn": "arn:aws:ec2:eu-west-1:111122223333:security-group/sg-0group1", |
| + "description": "carlos dev IE group", |
| + "egress": [], |
| + "id": "sg-0group1", |
| + "ingress": [ |
| + { |
| + "cidr_blocks": [], |
| + "description": "", |
| + "from_port": 80, |
| + "ipv6_cidr_blocks": [], |
| + "prefix_list_ids": [], |
| + "protocol": "tcp", |
| + "security_groups": [ |
| + "sg-0nlb1" |
| + ], |
| + "self": false, |
| + "to_port": 80 |
| + } |
| + ], |
| + "name": "carlos-dev-ie-group", |
| + "owner_id": "111122223333", |
| + "region": "eu-west-1", |
| + "revoke_rules_on_delete": false, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "timeouts": null, |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + } |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| + } |
| + }, |
| + "resource_changes": [ |
| + { |
| + "address": "module.host_ie_group.aws_iam_role.host", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:iam::111122223333:role/carlos-dev-ie-group", |
| + "assume_role_policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"ec2.amazonaws.com\"}, \"Action\": \"sts:AssumeRole\"}]}", |
| + "description": "", |
| + "force_detach_policies": false, |
| + "id": "carlos-dev-ie-group", |
| + "max_session_duration": 3600, |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "permissions_boundary": "", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AROAEXAMPLEGROUP0001" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_instance_profile.host", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:iam::111122223333:instance-profile/carlos-dev-ie-group", |
| + "create_date": "2026-11-04T18:39:20Z", |
| + "id": "carlos-dev-ie-group", |
| + "name": "carlos-dev-ie-group", |
| + "name_prefix": "", |
| + "path": "/", |
| + "role": "carlos-dev-ie-group", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "unique_id": "AIPAEXAMPLEGROUP0001" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_instance_profile" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy_attachment.host_ssm", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group/arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "policy_arn": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "policy_arn": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_ssm", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy_attachment" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.group[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-group", |
| + "name": "carlos-dev-ie-group-group", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"s3:GetObject\", \"Resource\": \"arn:aws:s3:::carlos-dev-platform/bootstrap/dev/ie/*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-group", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_buckets", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-buckets", |
| + "name": "carlos-dev-ie-group-buckets", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-buckets", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_buckets", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_metrics", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-metrics", |
| + "name": "carlos-dev-ie-group-metrics", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-metrics", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_metrics", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_ssm_parameter_scope[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-ssm-parameter-scope", |
| + "name": "carlos-dev-ie-group-ssm-parameter-scope", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-ssm-parameter-scope", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_ssm_parameter_scope", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_release_key_deny[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-release-key-deny", |
| + "name": "carlos-dev-ie-group-release-key-deny", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-release-key-deny", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_release_key_deny", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_iam_role_policy.host_terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "carlos-dev-ie-group:carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "name_prefix": "", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": \"cloudwatch:PutMetricData\", \"Resource\": \"*\"}]}", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "role": "carlos-dev-ie-group" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "host_terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_iam_role_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "message_retention_seconds": 86400, |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "sqs_managed_sse_enabled": true, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "region": "eu-west-1", |
| + "url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sqs_queue" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sqs_queue_policy.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "id": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations\"}}}]}", |
| + "queue_url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "queue_url": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sqs_queue_policy" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_rule.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:events:eu-west-1:111122223333:rule/carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "event_pattern": "{\"source\": [\"aws.ec2\"], \"detail-type\": [\"EC2 Instance State-change Notification\"]}", |
| + "id": "carlos-dev-ie-group-terminations", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1", |
| + "state": "ENABLED", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "event_bus_name": "default", |
| + "name": "carlos-dev-ie-group-terminations", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_rule" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_cloudwatch_event_target.terminations", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sqs:eu-west-1:111122223333:carlos-dev-ie-group-terminations", |
| + "event_bus_name": "default", |
| + "id": "carlos-dev-ie-group-terminations-queue", |
| + "region": "eu-west-1", |
| + "rule": "carlos-dev-ie-group-terminations", |
| + "target_id": "queue" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "event_bus_name": "default", |
| + "region": "eu-west-1", |
| + "rule": "carlos-dev-ie-group-terminations", |
| + "target_id": "queue" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "terminations", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_cloudwatch_event_target" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_queue[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "id": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "name": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "https://sqs.eu-west-1.amazonaws.com/111122223333/carlos-dev-ie-group-terminations", |
| + "version": 1 |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "/carlos/dev/ie/boot/CARLOS_TERMINATION_QUEUE_URL", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_queue", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_ssm_parameter.group_ingress[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:ssm:eu-west-1:111122223333:parameter/carlos/dev/ie/boot/ingress", |
| + "id": "/carlos/dev/ie/boot/ingress", |
| + "name": "/carlos/dev/ie/boot/ingress", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {}, |
| + "type": "String", |
| + "value": "{\"public_ips\": {\"eu-west-1a\": \"198.51.100.10\"}}", |
| + "version": 1 |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "name": "/carlos/dev/ie/boot/ingress", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group_ingress", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_ssm_parameter" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic.alerts[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts", |
| + "name": "carlos-dev-ie-group-alerts", |
| + "owner": "111122223333", |
| + "region": "eu-west-1", |
| + "tags": {}, |
| + "tags_all": {} |
| + }, |
| + "before_identity": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + }, |
| + "before_sensitive": { |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "alerts", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sns_topic" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_sns_topic_subscription.alerts_email[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "endpoint": "alerts@example.com", |
| + "id": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001", |
| + "pending_confirmation": true, |
| + "protocol": "email", |
| + "region": "eu-west-1", |
| + "topic_arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts" |
| + }, |
| + "before_identity": { |
| + "arn": "arn:aws:sns:eu-west-1:111122223333:carlos-dev-ie-group-alerts:00000000-0000-0000-0000-000000000001" |
| + }, |
| + "before_sensitive": {} |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "alerts_email", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_sns_topic_subscription" |
| + }, |
| + { |
| + "address": "module.host_ie_group.aws_security_group.group[0]", |
| + "change": { |
| + "actions": [ |
| + "delete" |
| + ], |
| + "after": null, |
| + "after_sensitive": false, |
| + "after_unknown": {}, |
| + "before": { |
| + "arn": "arn:aws:ec2:eu-west-1:111122223333:security-group/sg-0group1", |
| + "description": "carlos dev IE group", |
| + "egress": [], |
| + "id": "sg-0group1", |
| + "ingress": [ |
| + { |
| + "cidr_blocks": [], |
| + "description": "", |
| + "from_port": 80, |
| + "ipv6_cidr_blocks": [], |
| + "prefix_list_ids": [], |
| + "protocol": "tcp", |
| + "security_groups": [ |
| + "sg-0nlb1" |
| + ], |
| + "self": false, |
| + "to_port": 80 |
| + } |
| + ], |
| + "name": "carlos-dev-ie-group", |
| + "owner_id": "111122223333", |
| + "region": "eu-west-1", |
| + "revoke_rules_on_delete": false, |
| + "tags": {}, |
| + "tags_all": {}, |
| + "timeouts": null, |
| + "vpc_id": "vpc-0123456789abcdef0" |
| + }, |
| + "before_identity": { |
| + "account_id": "111122223333", |
| + "id": "sg-0group1", |
| + "region": "eu-west-1" |
| + }, |
| + "before_sensitive": { |
| + "egress": [], |
| + "ingress": [], |
| + "tags": {}, |
| + "tags_all": {} |
| + } |
| + }, |
| + "index": 0, |
| + "mode": "managed", |
| + "module_address": "module.host_ie_group", |
| + "name": "group", |
| + "provider_name": "registry.opentofu.org/hashicorp/aws", |
| + "type": "aws_security_group" |
| + } |
| + ], |
| + "terraform_version": "1.12.5", |
| + "timestamp": "2026-11-04T18:41:20Z" |
| +} |