Skip to content

fix(infra): remove the impersonation metric filter — its log group refuses filters (#1302) - #1303

Merged
athvin merged 1 commit into
mainfrom
fix/877-impersonation-filter
Nov 27, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/877-impersonation-filter

Conversation

@athvin

@athvin athvin commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Closes #1302

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

Remove aws_cloudwatch_log_metric_filter.impersonation and its alarm (with their variables and tests); correct the observability skill; regenerate the footprint.

The infra workflow on main failed in both envs on that filter (run 45933961412): the containers log group is Infrequent Access and refuses metric filters. #1301 re-scopes the alarm.

Proof

terraform validate and terraform test (2 passed) in the module; skills regen + check. The PR's plan shows the removal only.

Risk & rollback

Removes resources that were never created. Reverting re-breaks the infra workflow.

Post-merge ledger

Closed by: agent · session Claude Code:24d16c2e-fec6-49d8-9797-060338df4848 on Mac · 2026-11-27T04:01:18Z

Specific to this change

Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Files

🤖 Generated with Claude Code

…fuses filters (#1302)

#1293's filter on /er/{env}/containers was refused in dev and prod
(PutMetricFilter: only supported on the Standard log class); that group is
Infrequent Access by the P4 cost decision, so the infra workflow on main
would keep failing on it. The filter and its alarm come out; the failure
rate and spot interruption alarms stay. The BFF's er.audit.impersonation
line remains for #1301 to count through a Standard-class route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

terraform plan

9daf365 · run log and full plans

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

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.

Warning

This plan DESTROYS resources in: dev prod. Merging applies it unattended.
The apply refuses to run unless the merge commit message carries
ALLOW-DESTROY. Retitling is not enough on a single-commit PR — GitHub
uses the commit message there, not the title. Merge with
gh pr merge <n> --squash --subject '<subject> ALLOW-DESTROY'.

dev — 0 to add, 0 to change, 1 to DESTROY
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
data.aws_iam_policy_document.eso: Reading...
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_caller_identity.current: Reading...
data.aws_rds_engine_version.aurora_pg: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=1725605485]
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_region.current: Reading...
module.network.data.aws_availability_zones.available: Reading...
data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.obs_pod_trust: Reading...
data.aws_iam_policy_document.efs_csi_trust: Reading...
module.network.data.aws_region.current: Reading...
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.obs_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.er_api_pod_trust: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=4006586444]
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.otel_collector: Reading...
module.lake.data.aws_iam_policy_document.lake_tls_only: Reading...
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=3111493560]
module.lake.data.aws_iam_policy_document.lake_tls_only: Read complete after 0s [id=4017345831]
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=2921565705]
data.aws_iam_policy_document.bedrock_invoke: Reading...
data.aws_iam_policy_document.bedrock_invoke: Read complete after 0s [id=3601248236]
data.aws_rds_engine_version.aurora_pg: Read complete after 0s [id=17.9]
module.network.data.aws_availability_zones.available: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.ci_deploy_dev: Reading...
data.aws_iam_policy_document.ci_deploy_dev: Read complete after 0s [id=1754478413]
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.ci_deploy_dev_trust: Reading...
data.aws_iam_policy_document.ci_deploy_dev_trust: Read complete after 0s [id=4060172364]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # module.operations.aws_cloudwatch_metric_alarm.impersonation_volume[0] will be destroyed
  # (because aws_cloudwatch_metric_alarm.impersonation_volume is not in configuration)
  - resource "aws_cloudwatch_metric_alarm" "impersonation_volume" {
      - actions_enabled                       = true -> null
      - alarm_actions                         = [
          - "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ] -> null
      - alarm_description                     = "More than 20 impersonation events (start, stop or impersonated mutation) in an hour. Read erweb.audit for who and which org; operators impersonate to support a tenant, so a burst is either an incident being worked or a compromised operator session." -> null
      - alarm_name                            = "er-dev-impersonation-volume" -> null
      - arn                                   = "arn:aws:cloudwatch:us-east-2:797781631727:alarm:er-dev-impersonation-volume" -> null
      - comparison_operator                   = "GreaterThanThreshold" -> null
      - datapoints_to_alarm                   = 0 -> null
      - evaluation_interval                   = 0 -> null
      - evaluation_periods                    = 1 -> null
      - id                                    = "er-dev-impersonation-volume" -> null
      - metric_name                           = "er.audit.impersonations" -> null
      - namespace                             = "ER/Dev" -> null
      - ok_actions                            = [
          - "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ] -> null
      - period                                = 3600 -> null
      - region                                = "us-east-2" -> null
      - statistic                             = "Sum" -> null
      - tags_all                              = {
          - "Environment" = "dev"
          - "ManagedBy"   = "terraform"
          - "Project"     = "entity-resolution"
        } -> null
      - threshold                             = 20 -> null
      - treat_missing_data                    = "notBreaching" -> null
        # (4 unchanged attributes hidden)
    }

Plan: 0 to add, 0 to change, 1 to destroy.
prod — 0 to add, 0 to change, 1 to DESTROY
data.aws_iam_policy_document.efs_csi_trust: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
data.aws_caller_identity.current: Reading...
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_rds_engine_version.aurora_pg: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
data.aws_iam_policy_document.pod_trust: Reading...
data.aws_iam_policy_document.pod_trust: Read complete after 0s [id=819195744]
module.ses.data.aws_region.current: Reading...
module.network.data.aws_availability_zones.available: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
module.network.data.aws_region.current: Reading...
module.ses.data.aws_region.current: Read complete after 0s [id=us-east-2]
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
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.api_contract_bucket: Reading...
data.aws_iam_policy_document.api_contract_bucket: Read complete after 0s [id=1127163522]
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=1193716550]
module.lake.data.aws_iam_policy_document.lake_tls_only: Reading...
module.lake.data.aws_iam_policy_document.lake_tls_only: Read complete after 0s [id=2453399085]
data.aws_iam_policy_document.ci_deploy_prod_api_contract: Reading...
data.aws_iam_policy_document.ci_deploy_prod_api_contract: Read complete after 0s [id=3801820449]
data.aws_iam_policy_document.eso: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=2178872705]
data.aws_iam_policy_document.openobserve: Reading...
data.aws_iam_policy_document.openobserve: Read complete after 0s [id=2652188337]
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_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_rds_engine_version.aurora_pg: Read complete after 0s [id=17.9]
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.ci_deploy_prod: Reading...
data.aws_iam_policy_document.ci_deploy_prod: Read complete after 1s [id=2891227359]
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]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # module.operations.aws_cloudwatch_metric_alarm.impersonation_volume[0] will be destroyed
  # (because aws_cloudwatch_metric_alarm.impersonation_volume is not in configuration)
  - resource "aws_cloudwatch_metric_alarm" "impersonation_volume" {
      - actions_enabled                       = true -> null
      - alarm_actions                         = [
          - "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ] -> null
      - alarm_description                     = "More than 20 impersonation events (start, stop or impersonated mutation) in an hour. Read erweb.audit for who and which org; operators impersonate to support a tenant, so a burst is either an incident being worked or a compromised operator session." -> null
      - alarm_name                            = "er-prod-impersonation-volume" -> null
      - arn                                   = "arn:aws:cloudwatch:us-east-2:797781631727:alarm:er-prod-impersonation-volume" -> null
      - comparison_operator                   = "GreaterThanThreshold" -> null
      - datapoints_to_alarm                   = 0 -> null
      - evaluation_interval                   = 0 -> null
      - evaluation_periods                    = 1 -> null
      - id                                    = "er-prod-impersonation-volume" -> null
      - metric_name                           = "er.audit.impersonations" -> null
      - namespace                             = "ER/Prod" -> null
      - ok_actions                            = [
          - "arn:aws:sns:us-east-2:797781631727:er-alerts",
        ] -> null
      - period                                = 3600 -> null
      - region                                = "us-east-2" -> null
      - statistic                             = "Sum" -> null
      - tags_all                              = {
          - "Environment" = "prod"
          - "ManagedBy"   = "terraform"
          - "Project"     = "entity-resolution"
        } -> null
      - threshold                             = 20 -> null
      - treat_missing_data                    = "notBreaching" -> null
        # (4 unchanged attributes hidden)
    }

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

@athvin
athvin merged commit f76b16e into main Nov 27, 2026
40 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 27, 2026 03:54 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — 8f85fd7b Deployed Nov 27, 2026 by athvin via remove closed PR previews #91
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.

Infra on main fails since #1293: the impersonation metric filter targets an Infrequent-Access log group

2 participants