Skip to content

feat(observability): add operational dashboards and alerts (#552) - #1046

Merged
athvin merged 4 commits into
mainfrom
issue/552-operational-observability
Nov 9, 2026
Merged

athvin merged 4 commits into
mainfrom
issue/552-operational-observability

Conversation

@athvin

@athvin athvin commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #552

Claimed by an agent session — 2026-11-09T10:17:41.644666+00:00, session Codex:01a1be1b-0c92-7703-a4c2-25cb2c999baa on Mac-26.lan.
The claim is this open draft PR: closing it releases the ticket.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Add the shared dev/ci operations dashboard and SNS-backed backlog, missing-snapshot, OOM and eviction alarms. Supply bounded API RED, queue/concurrency, dispatch/task duration and retry/no-op instruments from committed control-plane state.

Why

The backend-design §14 signals lacked producers and actionable dashboards. Explicit zero snapshots distinguish idle from old gauge values; a heartbeat exposes failed reads or export. Only canonical deployments publish operational metrics, so isolated developer databases cannot overwrite the shared queue.

Proof

make check and make check-e2e passed on e18f8e8d481e35501d3f04190955fd1088fa597f; all 15 required CI contexts pass on that head (Rust 42607875922, infra 42607875889). Terraform validates, alarm mock-provider tests and chart checks pass. Negative probes rejected the wrong backlog statistic, developer namespace publication, stale eviction replay and cumulative counter export. The house review covered instrumentation, declared SQL, execution tier and reuse; independently verified event-counting findings were fixed and retested.

Risk & rollback

Counters can lose observations between commit and export; durable rows remain authoritative. The module adds CloudWatch series and alarms to the existing SNS topic. The missing-snapshot alarm may fire between Terraform apply and the first export from the new dispatcher. Prod module/collector wiring remains #944; cost attribution remains #667. Revert the commit to remove producers and Terraform-managed dashboard/alarms.

Post-merge ledger

Closed by: Codex · session Codex:01a1be1b-0c92-7703-a4c2-25cb2c999baa on Mac-26.lan · 2026-11-09T12:04:34Z — ledger reconciled with blocked items left empty.

Specific to this change

  • Terraform installed the operational dashboard and four alarms in dev — infra 42610044722 completed core/dev/prod applies successfully.
  • Independent metric/alarms readback — er-readonly CloudWatch queries on 2026-11-09 found real ER/Dev and ER/Prod samples (dimension OTelLib=er-obs) for er.ops.snapshots and er.pods.snapshots, two samples/minute at 15:07–15:08Z, plus queue/pending oldest-age gauges at zero seconds. All seven operational alarms in both environments read OK during the 15:12–15:13Z audit. The prior read-access limitation is resolved.
  • SNS delivery — blocked — er-alerts still has a PendingConfirmation email subscription. Owner confirmation and receipt verification are tracked in Confirm the er-alerts email subscription and prove alert delivery #1056; alarm state alone does not prove delivery.
Context — plan, discoveries, measurements, files

Plan

  • Read Observability completion — dashboards and alerts #552, backend-design §14, infrastructure §10, the metric registry, dispatcher/task lifecycle, collector, existing alarms, and routed skills. Confirm the higher-ranked In progress items remain blocked by shared API dependencies or peer-owned feat(review): per-record Delete, Verify, and a durable Unmatch distinct from unmerge #803.
  • Map each acceptance signal to its real producer and consumer. Preserve per-tenant data-quality reporting in the product data path; never add tenant identifiers to billed metrics. Distinguish the deployed dev collector from the prod topology work already tracked in Prod observability install: span-store topology decision + prod shipper values #944.
  • Add bounded operational instruments in rust/crates/er-obs, registered with closed dimensions, and the producer calls in er-server. Read current queue/concurrency through declared entities/ aggregate statements; record task counters only after guarded writes commit. The query generator needed typed Postgres read projections: they reuse its binding/span path, retain E003 shape checks, and reject typed writes.
  • Add Terraform dashboards and actionable queue-depth and eviction/OOM alarms using the existing SNS destination. Cover API RED, dispatch latency, per-class concurrency, stage duration, retry/no-op rates, and link the existing tenant data-quality surface. Include signal freshness and explain missing data.
  • Prove actual emission and negative cases in the existing meter and real-Postgres harnesses; test alarm/dashboard dimensions against the registry and validate Terraform. Run make check, make check-e2e, and the relevant infra gates. Regenerate entity and skill artifacts rather than hand-editing them.
  • Run the house diff review and independently verify the corrections.
  • Land through land-pr, observe applied dashboards/alarms and live metric samples, and close the post-merge ledger with deployment dependencies and blocked read access explicitly recorded.

Discoveries

The house review checked instrumentation, declared SQL, execution tier and reuse, with directory passes for the larger diff and independent finding verification. It found that successful relaunches retain old eviction reasons and could count them again; completion observations now count pod failures only for failed outcomes. It also exposed awsemf’s discarded initial cumulative sample: native SDK deltas preserve the first rare event without replaying lifetime counts after collector restart. A real HTTP/protobuf regression test checks counter and histogram temporality and gauge values; both the old cumulative setting and stale-reason emission were deliberately restored and observed failing before the corrected tests passed. Typed row-decoding errors also pass through the existing span outcome helper.

Pipeline semantics are supported by the pinned awsemf implementation and OpenObserve’s delta-metric ingestion guidance. These are compatibility evidence, not live account validation. The local command guard rejected read-only CloudWatch list-metrics and SNS subscription listing; those live checks remain unverified.

Developer namespaces have independent databases. ER_OPERATIONAL_METRICS is enabled by the chart only for dev/ci and prod/app; developer and local processes keep their normal telemetry but cannot overwrite the shared operational gauges. Production dashboard installation still depends on #944.

Implementation now includes closed-vocabulary API/status and task/class instruments, queue/concurrency snapshots with explicit zeros and a freshness heartbeat, and post-commit outcomes/retries/confirmed OOM/eviction counts. The dev dashboard uses means and interval counter rates; its backlog alarm reads a separate simultaneous total with Minimum over three five-minute periods. Prod operational module wiring remains dependent on existing #944; no prod coverage is claimed.

Focused checks so far: entity verification passes; the real Postgres queue/concurrency test passes; the in-memory meter test confirms emission, dimension bounds, and clearing stale queue values; dev Terraform validates. make check, local e2e and full CI passed again after the independently verified review corrections.

Before this change, the registry declared only database duration and span-export health metrics. The requested queue, concurrency, retry/outcome and API RED signals need producers before dashboards can be meaningful. task_instances already persists resource class, timestamps, terminal reason, outcome and retry history; reuse it rather than introduce another operational state store. ER_PROFILE_* and span events in the older rollout checklist are obsolete; #552's revised issue scope is dashboards plus queue/eviction/OOM alerts, with cost attribution split to #667.

Measurements

Files

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

terraform plan

ec9a4ec · run log and full plans

env add change destroy
state-backend (plan only) 0 0 0
core 0 0 0
dev 11 1 0
prod 6 1 0

Planned with -refresh=false, so this is the config-versus-state diff and
not out-of-band drift. That is a security choice, not a speed one: a refreshing
plan reads secret values, and the plan role is assumable from any PR branch —
which can edit the workflow it runs under. Drift is caught at apply time, which
refreshes fully.

dev — 11 to add, 1 to change

Showing the last 29000 of 98169 characters — the full plan is in the run summary.

OD(m3)"
                                      + id         = "r3"
                                      + label      = "other"
                                    },
                                ],
                            ]
                          + period  = 60
                          + region  = "us-east-2"
                          + stat    = "Sum"
                          + title   = "no_op task events / second"
                          + view    = "timeSeries"
                        }
                      + type       = "metric"
                      + width      = 12
                      + x          = 12
                      + y          = 34
                    },
                  + {
                      + height     = 6
                      + properties = {
                          + metrics = [
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "S",
                                  + "reason",
                                  + "oom",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "S oom"
                                    },
                                ],
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "S",
                                  + "reason",
                                  + "evicted",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "S evicted"
                                    },
                                ],
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "M",
                                  + "reason",
                                  + "oom",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "M oom"
                                    },
                                ],
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "M",
                                  + "reason",
                                  + "evicted",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "M evicted"
                                    },
                                ],
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "L",
                                  + "reason",
                                  + "oom",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "L oom"
                                    },
                                ],
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "L",
                                  + "reason",
                                  + "evicted",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "L evicted"
                                    },
                                ],
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "other",
                                  + "reason",
                                  + "oom",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "other oom"
                                    },
                                ],
                              + [
                                  + "ER/Dev",
                                  + "er.pods.failures",
                                  + "resource_class",
                                  + "other",
                                  + "reason",
                                  + "evicted",
                                  + "OTelLib",
                                  + "er-obs",
                                  + {
                                      + label = "other evicted"
                                    },
                                ],
                            ]
                          + period  = 60
                          + region  = "us-east-2"
                          + stat    = "Sum"
                          + title   = "Confirmed pod OOM kills and evictions / minute"
                          + view    = "timeSeries"
                        }
                      + type       = "metric"
                      + width      = 24
                      + x          = 0
                      + y          = 40
                    },
                ]
            }
        )
      + dashboard_name = "er-dev-operations"
      + id             = (known after apply)
      + region         = "us-east-2"
    }

  # module.operations.aws_cloudwatch_metric_alarm.pod_failure["evicted"] will be created
  + resource "aws_cloudwatch_metric_alarm" "pod_failure" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + alarm_description                     = "A runner evicted was confirmed in the last five minutes. Inspect the task's durable termination reason and resource class; check memory, ephemeral storage and node disruption before retrying."
      + alarm_name                            = "er-dev-pod-evicted"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + ok_actions                            = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + region                                = "us-east-2"
      + tags_all                              = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + threshold                             = 0
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "p0"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "evicted"
                  + "resource_class" = "S"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + id          = "p1"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "evicted"
                  + "resource_class" = "M"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + id          = "p2"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "evicted"
                  + "resource_class" = "L"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + id          = "p3"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "evicted"
                  + "resource_class" = "other"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + expression  = "SUM([FILL(p0,0),FILL(p1,0),FILL(p2,0),FILL(p3,0)])"
          + id          = "total"
          + return_data = true
            # (2 unchanged attributes hidden)
        }
    }

  # module.operations.aws_cloudwatch_metric_alarm.pod_failure["oom"] will be created
  + resource "aws_cloudwatch_metric_alarm" "pod_failure" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + alarm_description                     = "A runner oom was confirmed in the last five minutes. Inspect the task's durable termination reason and resource class; check memory, ephemeral storage and node disruption before retrying."
      + alarm_name                            = "er-dev-pod-oom"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + ok_actions                            = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + region                                = "us-east-2"
      + tags_all                              = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + threshold                             = 0
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "p0"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "oom"
                  + "resource_class" = "S"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + id          = "p1"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "oom"
                  + "resource_class" = "M"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + id          = "p2"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "oom"
                  + "resource_class" = "L"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + id          = "p3"
          + return_data = false
            # (3 unchanged attributes hidden)

          + metric {
              + dimensions  = {
                  + "OTelLib"        = "er-obs"
                  + "reason"         = "oom"
                  + "resource_class" = "other"
                }
              + metric_name = "er.pods.failures"
              + namespace   = "ER/Dev"
              + period      = 300
              + stat        = "Sum"
                # (1 unchanged attribute hidden)
            }
        }
      + metric_query {
          + expression  = "SUM([FILL(p0,0),FILL(p1,0),FILL(p2,0),FILL(p3,0)])"
          + id          = "total"
          + return_data = true
            # (2 unchanged attributes hidden)
        }
    }

  # module.operations.aws_cloudwatch_metric_alarm.queue_depth will be created
  + resource "aws_cloudwatch_metric_alarm" "queue_depth" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + alarm_description                     = "At least 100 jobs have waited for 15 minutes. Inspect dispatcher readiness, per-class concurrency, pod capacity and job backoff. Includes scheduled delays; confirm service rate before changing capacity."
      + alarm_name                            = "er-dev-queue-backlog"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + datapoints_to_alarm                   = 3
      + dimensions                            = {
          + "OTelLib" = "er-obs"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 3
      + id                                    = (known after apply)
      + metric_name                           = "er.jobs.queue.total"
      + namespace                             = "ER/Dev"
      + ok_actions                            = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + period                                = 300
      + region                                = "us-east-2"
      + statistic                             = "Minimum"
      + tags_all                              = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + threshold                             = 100
      + treat_missing_data                    = "notBreaching"
    }

  # module.operations.aws_cloudwatch_metric_alarm.snapshot_missing will be created
  + resource "aws_cloudwatch_metric_alarm" "snapshot_missing" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + alarm_description                     = "No successful queue/concurrency snapshots for three minutes. Check dispatcher process, database reads and the metric export pipeline; empty queue charts are not evidence of idle until this recovers."
      + alarm_name                            = "er-dev-operational-snapshot-missing"
      + arn                                   = (known after apply)
      + comparison_operator                   = "LessThanThreshold"
      + datapoints_to_alarm                   = 3
      + dimensions                            = {
          + "OTelLib" = "er-obs"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 3
      + id                                    = (known after apply)
      + metric_name                           = "er.ops.snapshots"
      + namespace                             = "ER/Dev"
      + ok_actions                            = [
          + "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ]
      + period                                = 60
      + region                                = "us-east-2"
      + statistic                             = "Sum"
      + tags_all                              = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + threshold                             = 1
      + treat_missing_data                    = "breaching"
    }

  # module.tenant_runners.aws_eks_pod_identity_association.tenant["ci/isolation-probe-a"] will be created
  + resource "aws_eks_pod_identity_association" "tenant" {
      + association_arn      = (known after apply)
      + association_id       = (known after apply)
      + cluster_name         = "er-dev"
      + disable_session_tags = false
      + external_id          = (known after apply)
      + id                   = (known after apply)
      + namespace            = "ci"
      + region               = "us-east-2"
      + role_arn             = (known after apply)
      + service_account      = "er-runner-93ccc8f077814e800e7a"
      + tags_all             = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
    }

  # module.tenant_runners.aws_eks_pod_identity_association.tenant["ci/isolation-probe-b"] will be created
  + resource "aws_eks_pod_identity_association" "tenant" {
      + association_arn      = (known after apply)
      + association_id       = (known after apply)
      + cluster_name         = "er-dev"
      + disable_session_tags = false
      + external_id          = (known after apply)
      + id                   = (known after apply)
      + namespace            = "ci"
      + region               = "us-east-2"
      + role_arn             = (known after apply)
      + service_account      = "er-runner-c6090ab88ffa4d30bb25"
      + tags_all             = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
    }

  # module.tenant_runners.aws_iam_role.tenant["ci/isolation-probe-a"] will be created
  + resource "aws_iam_role" "tenant" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = [
                          + "sts:AssumeRole",
                          + "sts:TagSession",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:RequestTag/eks-cluster-arn"            = "arn:aws:eks:us-east-2:797781631727:cluster/er-dev"
                              + "aws:RequestTag/kubernetes-namespace"       = "ci"
                              + "aws:RequestTag/kubernetes-service-account" = "er-runner-93ccc8f077814e800e7a"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "pods.eks.amazonaws.com"
                        }
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "er-dev-runner-cdd932a93c2249b8a621"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + unique_id             = (known after apply)

      + inline_policy (known after apply)
    }

  # module.tenant_runners.aws_iam_role.tenant["ci/isolation-probe-b"] will be created
  + resource "aws_iam_role" "tenant" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = [
                          + "sts:AssumeRole",
                          + "sts:TagSession",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:RequestTag/eks-cluster-arn"            = "arn:aws:eks:us-east-2:797781631727:cluster/er-dev"
                              + "aws:RequestTag/kubernetes-namespace"       = "ci"
                              + "aws:RequestTag/kubernetes-service-account" = "er-runner-c6090ab88ffa4d30bb25"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "pods.eks.amazonaws.com"
                        }
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "er-dev-runner-20ada9dc46d46007ab8d"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + unique_id             = (known after apply)

      + inline_policy (known after apply)
    }

  # module.tenant_runners.aws_iam_role_policy.lake["ci/isolation-probe-a"] will be created
  + resource "aws_iam_role_policy" "lake" {
      + id          = (known after apply)
      + name        = "tenant-lake"
      + name_prefix = (known after apply)
      + policy      = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "s3:GetObject",
                          + "s3:PutObject",
                          + "s3:DeleteObject",
                          + "s3:AbortMultipartUpload",
                          + "s3:ListMultipartUploadParts",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-dev-lake-797781631727/_isolation/probe-a/*",
                        ]
                      + Sid      = "TenantObjects"
                    },
                  + {
                      + Action    = [
                          + "s3:ListBucket",
                        ]
                      + Condition = {
                          + StringLike = {
                              + "s3:prefix" = [
                                  + "_isolation/probe-a/*",
                                ]
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:s3:::er-dev-lake-797781631727",
                        ]
                      + Sid       = "TenantList"
                    },
                  + {
                      + Action   = [
                          + "s3:GetBucketLocation",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-dev-lake-797781631727",
                        ]
                      + Sid      = "BucketLocation"
                    },
                  + {
                      + Action    = [
                          + "kms:Decrypt",
                          + "kms:GenerateDataKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "kms:EncryptionContext:aws:s3:arn" = "arn:aws:s3:::er-dev-lake-797781631727"
                              + "kms:ViaService"                   = "s3.us-east-2.amazonaws.com"
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:kms:us-east-2:797781631727:key/0c226b8f-de72-4f5f-b50b-0cf1391bc325",
                        ]
                      + Sid       = "LakeKeyViaS3"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + role        = (known after apply)
    }

  # module.tenant_runners.aws_iam_role_policy.lake["ci/isolation-probe-b"] will be created
  + resource "aws_iam_role_policy" "lake" {
      + id          = (known after apply)
      + name        = "tenant-lake"
      + name_prefix = (known after apply)
      + policy      = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "s3:GetObject",
                          + "s3:PutObject",
                          + "s3:DeleteObject",
                          + "s3:AbortMultipartUpload",
                          + "s3:ListMultipartUploadParts",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-dev-lake-797781631727/_isolation/probe-b/*",
                        ]
                      + Sid      = "TenantObjects"
                    },
                  + {
                      + Action    = [
                          + "s3:ListBucket",
                        ]
                      + Condition = {
                          + StringLike = {
                              + "s3:prefix" = [
                                  + "_isolation/probe-b/*",
                                ]
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:s3:::er-dev-lake-797781631727",
                        ]
                      + Sid       = "TenantList"
                    },
                  + {
                      + Action   = [
                          + "s3:GetBucketLocation",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-dev-lake-797781631727",
                        ]
                      + Sid      = "BucketLocation"
                    },
                  + {
                      + Action    = [
                          + "kms:Decrypt",
                          + "kms:GenerateDataKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "kms:EncryptionContext:aws:s3:arn" = "arn:aws:s3:::er-dev-lake-797781631727"
                              + "kms:ViaService"                   = "s3.us-east-2.amazonaws.com"
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:kms:us-east-2:797781631727:key/0c226b8f-de72-4f5f-b50b-0cf1391bc325",
                        ]
                      + Sid       = "LakeKeyViaS3"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + role        = (known after apply)
    }

Plan: 11 to add, 1 to change, 0 to destroy.
prod — 6 to add, 1 to change
module.ses.data.aws_region.current: Reading...
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_rds_engine_version.aurora_pg: Reading...
data.aws_iam_policy_document.pod_trust: Reading...
module.network.data.aws_availability_zones.available: Reading...
module.ses.data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.pod_trust: Read complete after 0s [id=819195744]
data.aws_caller_identity.current: Reading...
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.network.data.aws_region.current: Reading...
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
data.aws_iam_policy_document.efs_csi_trust: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=2978074842]
data.aws_iam_policy_document.otel_collector: Reading...
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=1193716550]
module.lake.data.aws_iam_policy_document.lake_tls_only: Reading...
data.aws_iam_policy_document.eso: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=2178872705]
module.lake.data.aws_iam_policy_document.lake_tls_only: Read complete after 0s [id=3960055703]
module.ses.data.aws_iam_policy_document.send: Reading...
module.ses.data.aws_iam_policy_document.send: Read complete after 0s [id=3767633194]
data.aws_iam_openid_connect_provider.github: Read complete after 0s [id=arn:aws:iam::797781631727:oidc-provider/token.actions.githubusercontent.com]
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=1033619361]
module.network.data.aws_availability_zones.available: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.ci_deploy_prod_trust: Reading...
data.aws_iam_policy_document.ci_deploy_prod_trust: Read complete after 0s [id=4060172364]
data.aws_rds_engine_version.aurora_pg: Read complete after 0s [id=17.9]
data.aws_iam_policy_document.ci_deploy_prod: Reading...
data.aws_iam_policy_document.ci_deploy_prod: Read complete after 0s [id=3634844169]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_iam_role_policy.er_runner_lake will be updated in-place
  ~ resource "aws_iam_role_policy" "er_runner_lake" {
        id          = "er-prod-runner-pod:er-prod-runner-lake"
        name        = "er-prod-runner-lake"
      ~ policy      = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Action   = [
                          - "s3:PutObject",
                          - "s3:ListMultipartUploadParts",
                          - "s3:GetObject",
                          - "s3:DeleteObject",
                          - "s3:AbortMultipartUpload",
                        ] -> "s3:GetBucketLocation"
                      ~ Resource = "arn:aws:s3:::er-prod-lake-797781631727/*" -> "arn:aws:s3:::er-prod-lake-797781631727"
                      ~ Sid      = "LakeObjects" -> "BucketLocationOnly"
                        # (1 unchanged attribute hidden)
                    },
                  - {
                      - Action   = [
                          - "s3:ListBucketMultipartUploads",
                          - "s3:ListBucket",
                          - "s3:GetBucketLocation",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:s3:::er-prod-lake-797781631727"
                      - Sid      = "LakeList"
                    },
                  - {
                      - Action   = [
                          - "kms:GenerateDataKey*",
                          - "kms:Decrypt",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:kms:us-east-2:797781631727:key/aac8b63d-fd14-4c13-896e-ceaa41dcf0ce"
                      - Sid      = "LakeKey"
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (2 unchanged attributes hidden)
    }

  # module.tenant_runners.aws_eks_pod_identity_association.tenant["app/isolation-probe-a"] will be created
  + resource "aws_eks_pod_identity_association" "tenant" {
      + association_arn      = (known after apply)
      + association_id       = (known after apply)
      + cluster_name         = "er-prod"
      + disable_session_tags = false
      + external_id          = (known after apply)
      + id                   = (known after apply)
      + namespace            = "app"
      + region               = "us-east-2"
      + role_arn             = (known after apply)
      + service_account      = "er-runner-93ccc8f077814e800e7a"
      + tags_all             = {
          + "Environment" = "prod"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
    }

  # module.tenant_runners.aws_eks_pod_identity_association.tenant["app/isolation-probe-b"] will be created
  + resource "aws_eks_pod_identity_association" "tenant" {
      + association_arn      = (known after apply)
      + association_id       = (known after apply)
      + cluster_name         = "er-prod"
      + disable_session_tags = false
      + external_id          = (known after apply)
      + id                   = (known after apply)
      + namespace            = "app"
      + region               = "us-east-2"
      + role_arn             = (known after apply)
      + service_account      = "er-runner-c6090ab88ffa4d30bb25"
      + tags_all             = {
          + "Environment" = "prod"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
    }

  # module.tenant_runners.aws_iam_role.tenant["app/isolation-probe-a"] will be created
  + resource "aws_iam_role" "tenant" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = [
                          + "sts:AssumeRole",
                          + "sts:TagSession",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:RequestTag/eks-cluster-arn"            = "arn:aws:eks:us-east-2:797781631727:cluster/er-prod"
                              + "aws:RequestTag/kubernetes-namespace"       = "app"
                              + "aws:RequestTag/kubernetes-service-account" = "er-runner-93ccc8f077814e800e7a"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "pods.eks.amazonaws.com"
                        }
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "er-prod-runner-79b3a4bd146119bda02f"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Environment" = "prod"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + unique_id             = (known after apply)

      + inline_policy (known after apply)
    }

  # module.tenant_runners.aws_iam_role.tenant["app/isolation-probe-b"] will be created
  + resource "aws_iam_role" "tenant" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = [
                          + "sts:AssumeRole",
                          + "sts:TagSession",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:RequestTag/eks-cluster-arn"            = "arn:aws:eks:us-east-2:797781631727:cluster/er-prod"
                              + "aws:RequestTag/kubernetes-namespace"       = "app"
                              + "aws:RequestTag/kubernetes-service-account" = "er-runner-c6090ab88ffa4d30bb25"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "pods.eks.amazonaws.com"
                        }
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "er-prod-runner-9ba07546e1359bb14800"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Environment" = "prod"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }
      + unique_id             = (known after apply)

      + inline_policy (known after apply)
    }

  # module.tenant_runners.aws_iam_role_policy.lake["app/isolation-probe-a"] will be created
  + resource "aws_iam_role_policy" "lake" {
      + id          = (known after apply)
      + name        = "tenant-lake"
      + name_prefix = (known after apply)
      + policy      = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "s3:GetObject",
                          + "s3:PutObject",
                          + "s3:DeleteObject",
                          + "s3:AbortMultipartUpload",
                          + "s3:ListMultipartUploadParts",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-prod-lake-797781631727/_isolation/probe-a/*",
                        ]
                      + Sid      = "TenantObjects"
                    },
                  + {
                      + Action    = [
                          + "s3:ListBucket",
                        ]
                      + Condition = {
                          + StringLike = {
                              + "s3:prefix" = [
                                  + "_isolation/probe-a/*",
                                ]
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:s3:::er-prod-lake-797781631727",
                        ]
                      + Sid       = "TenantList"
                    },
                  + {
                      + Action   = [
                          + "s3:GetBucketLocation",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-prod-lake-797781631727",
                        ]
                      + Sid      = "BucketLocation"
                    },
                  + {
                      + Action    = [
                          + "kms:Decrypt",
                          + "kms:GenerateDataKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "kms:EncryptionContext:aws:s3:arn" = "arn:aws:s3:::er-prod-lake-797781631727"
                              + "kms:ViaService"                   = "s3.us-east-2.amazonaws.com"
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:kms:us-east-2:797781631727:key/aac8b63d-fd14-4c13-896e-ceaa41dcf0ce",
                        ]
                      + Sid       = "LakeKeyViaS3"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + role        = (known after apply)
    }

  # module.tenant_runners.aws_iam_role_policy.lake["app/isolation-probe-b"] will be created
  + resource "aws_iam_role_policy" "lake" {
      + id          = (known after apply)
      + name        = "tenant-lake"
      + name_prefix = (known after apply)
      + policy      = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "s3:GetObject",
                          + "s3:PutObject",
                          + "s3:DeleteObject",
                          + "s3:AbortMultipartUpload",
                          + "s3:ListMultipartUploadParts",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-prod-lake-797781631727/_isolation/probe-b/*",
                        ]
                      + Sid      = "TenantObjects"
                    },
                  + {
                      + Action    = [
                          + "s3:ListBucket",
                        ]
                      + Condition = {
                          + StringLike = {
                              + "s3:prefix" = [
                                  + "_isolation/probe-b/*",
                                ]
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:s3:::er-prod-lake-797781631727",
                        ]
                      + Sid       = "TenantList"
                    },
                  + {
                      + Action   = [
                          + "s3:GetBucketLocation",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::er-prod-lake-797781631727",
                        ]
                      + Sid      = "BucketLocation"
                    },
                  + {
                      + Action    = [
                          + "kms:Decrypt",
                          + "kms:GenerateDataKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "kms:EncryptionContext:aws:s3:arn" = "arn:aws:s3:::er-prod-lake-797781631727"
                              + "kms:ViaService"                   = "s3.us-east-2.amazonaws.com"
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:kms:us-east-2:797781631727:key/aac8b63d-fd14-4c13-896e-ceaa41dcf0ce",
                        ]
                      + Sid       = "LakeKeyViaS3"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + role        = (known after apply)
    }

Plan: 6 to add, 1 to change, 0 to destroy.

@athvin
athvin marked this pull request as ready for review November 9, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Observability completion — dashboards and alerts

2 participants