Skip to content

feat(prod): enable verified TLS and the maintenance lock budget - #991

Merged
athvin merged 9 commits into
mainfrom
issue/553-prod-tls-cutover
Nov 21, 2026
Merged

athvin merged 9 commits into
mainfrom
issue/553-prod-tls-cutover

Conversation

@athvin

@athvin athvin commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #553

Require verified PostgreSQL TLS in production and configure the Aurora cluster lock budget for DuckLake maintenance. The shared and control-plane DSNs use sslmode=verify-full&sslrootcert=/etc/ssl/rds/global-bundle.pem; the new cluster parameter group sets max_locks_per_transaction=1024 with pending-reboot activation.

Merged as ec16e8553689cb734d1b6317e60e29a78aa9f9d4 on 2026-11-21 at 03:48:38 UTC; production cutover acceptance and the 30-minute post-merge watch are complete. On 2026-11-20 the operator updated the Terraform-ignored frontend secret, preserving unrelated fields, and authorized the production restart. The latest main is merged into this branch for refreshed validation and a new plan. Production web/API and dispatcher pods were observed Running and ready. The operator completed the persisted catalog DSN audit/update and verified both connections; parameter activation, workload reload, and isolated maintenance proof all passed; see the ledger.

Production has a single Aurora instance: reboot activation causes a database outage. Terraform apply is CI-owned. Reviewed final PR plan run 44862733397: prod 3 add / 1 change / 2 immutable secret-version replacements; all other stacks unchanged. No database, instance, bucket or credential replacement. Squash subject explicitly includes ALLOW-DESTROY for those two secret-version replacements.

The operator handles commands refused by the agent execution guard. Local preparation and historical evidence are in .tools/prod-553/operator-steps.md; probe image references were refreshed from running pods and client dry-run passed; live execution succeeded and its isolated database was removed. TLS runtime capability shipped in #989 and #1005. The 14-day PITR decision is already recorded on #553.

Rollback: restore the previous TLS query options and reload the workloads. No credential rotation is intended.

Post-merge ledger

Closed by: Codex · session 01a1fbe5-2539-76f2-8999-ac4007ac8460 on brians-MacBook-Pro · 2026-11-21T04:19:08Z

  • main is green with this change on it — merge ec16e8553689cb734d1b6317e60e29a78aa9f9d4; rust 44862998756, frontend 44862998496, infra 44862998450 and devcontainer 44862998372 succeeded. Production apply completed at 2026-11-21T03:53:29Z: 3 added / 1 changed / 2 old secret versions retired. Live acceptance passed and the post-merge watch completed after 04:18:38 UTC without new failures; later main head 7426991f also has successful checks and production deploy 44864345806.
  • images — n/a: this Terraform/reference-only change touches no image inputs; no image workflow was triggered.
  • deploy converged — concurrent production deploy 44863604441 succeeded; operator captured serving API er-server listening at 2026-11-21T03:57:30.146157Z. Dispatcher rollout succeeded after ESO refresh. Independently observed serving API/web 2/2 ready and dispatcher 1/1 ready, zero restarts after acceptance.
  • the push-only surface — 30-minute watch completed through 2026-11-21T04:19:08Z. Production deploys 44863604441 and 44864345806 succeeded. Latest kind nightly 44690221398 succeeded. Drift 44862460349 was already red before this merge solely for the unconfirmed alert subscriber (The er-alerts SNS email subscription has never been confirmed — 19 armed alarms reach nobody #1107); no new failure appeared during the watch.
  • the board card — issue Prod environment — network, EKS, Aurora #553 closed after live acceptance; Product Roadmap card independently reads Done. No manual board movement performed.
  • follow-ups — no new deferred acceptance work; existing unrelated alarm-delivery issue remains The er-alerts SNS email subscription has never been confirmed — 19 armed alarms reach nobody #1107.
  • what was learned is written down — final acceptance and historical preparation recorded on Prod environment — network, EKS, Aurora #553 and in .tools/prod-553/operator-steps.md. ESO refresh precedes reload; catalog URL copies need their own transaction; single-instance reboot is an outage. No new product invariant was introduced.

Specific to this change

  • Update the existing er/prod/app/erweb secret with read-modify-write, preserving every other key — operator ran the tested preservation helper and Secrets Manager accepted version be65fba0-9cb5-4eaf-805f-9433ea1bb9a3 on 2026-11-20. Runtime verified-TLS connectivity passed in the isolated probe below.
  • Workloads reloaded after ESO force-sync — projected web/server DSNs independently verified with credential-redacting reads. New serving web/API pod and restarted dispatcher observed ready; API startup line and successful probe prove runtime acceptance.
  • Audit/update persisted catalog DSNs — operator transaction reported committed:true for org 01a1bf2f-f762-756e-8590-37e16fd0d096 and dataset 01a1bf2f-f79c-7105-9fb0-1fe632d5d141; both tls:verify-full, connectivity:verified, otherFields:preserved. Evidence supplied in this session on 2026-11-21 UTC.
  • Static parameter activated — operator rebooted er-prod-2; API readback available / group er-prod / in-sync, followed by probe SQL readback max_locks_per_transaction:1024.
  • er maintain acceptance recorded on Prod environment — network, EKS, Aurora #553 — Job app/er-tls-probe-553 independently observed Complete, 1/1 in 9 seconds. Operator logs show verified TLS, 1024 locks, successful isolated-catalog maintenance and isolated probe database removed. This proves the operation against Aurora, not performance on customer data.
  • Probe PodSecurity warning addressed for future runs — local manifest/template now specify non-root execution, RuntimeDefault seccomp, no privilege escalation and ALL capabilities dropped; client dry-run passed. Completed live Job was not modified and retains its TTL cleanup.
  • 14-day PITR — owner decision on Prod environment — network, EKS, Aurora #553; operator readback on 2026-11-21 UTC reconfirmed RetentionDays:14, cluster available, sole writer er-prod-2.

Audit trail

Branch refresh merge commits created in this session: 2ac1a6d0, 1bb0ad0f, a00847e3, 0e7b3eee. Final squash merge: ec16e855. No follow-up PR was needed. Operator executed guarded AWS/Kubernetes writes and supplied the acceptance logs; Codex prepared and validated local helpers, landed the change, independently read projected-secret settings and pod/Job state, and completed the CI watch.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

terraform plan

8e47fc7 · run log and full plans

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

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: 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'.

prod — 3 to add, 1 to change, 2 to DESTROY
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
data.aws_iam_policy_document.efs_csi_trust: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
module.network.data.aws_region.current: Reading...
module.ses.data.aws_region.current: Reading...
data.aws_caller_identity.current: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
module.ses.data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.pod_trust: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Reading...
data.aws_rds_engine_version.aurora_pg: Reading...
module.network.data.aws_availability_zones.available: Reading...
data.aws_iam_policy_document.pod_trust: Read complete after 0s [id=819195744]
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.openobserve: Reading...
data.aws_iam_policy_document.openobserve: Read complete after 0s [id=2652188337]
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=1193716550]
module.lake.data.aws_iam_policy_document.lake_tls_only: Read complete after 0s [id=3960055703]
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.eso: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=2178872705]
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.ses.data.aws_iam_policy_document.send: Reading...
module.ses.data.aws_iam_policy_document.send: Read complete after 0s [id=3767633194]
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=2891227359]

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

Terraform will perform the following actions:

  # aws_rds_cluster.prod will be updated in-place
  ~ resource "aws_rds_cluster" "prod" {
      ~ db_cluster_parameter_group_name       = "default.aurora-postgresql17" -> "er-prod"
        id                                    = "er-prod"
        tags                                  = {}
        # (62 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # aws_rds_cluster_parameter_group.prod will be created
  + resource "aws_rds_cluster_parameter_group" "prod" {
      + arn         = (known after apply)
      + description = "Prod Aurora parameters for DuckLake maintenance"
      + family      = "aurora-postgresql17"
      + id          = (known after apply)
      + name        = "er-prod"
      + name_prefix = (known after apply)
      + region      = "us-east-2"
      + tags_all    = {
          + "Environment" = "prod"
          + "ManagedBy"   = "terraform"
          + "Project"     = "entity-resolution"
        }

      + parameter {
          + apply_method = "pending-reboot"
          + name         = "max_locks_per_transaction"
          + value        = "1024"
        }
    }

  # aws_secretsmanager_secret_version.db must be replaced
-/+ resource "aws_secretsmanager_secret_version" "db" {
      ~ arn                  = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/prod/shared/postgres-97WGM5" -> (known after apply)
      + has_secret_string_wo = (known after apply)
      ~ id                   = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/prod/shared/postgres-97WGM5|terraform-W97c8HtjP0m14x6LWqxm90VcMt" -> (known after apply)
      ~ secret_arn           = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/prod/shared/postgres-97WGM5" -> (known after apply)
      ~ secret_string        = (sensitive value) # forces replacement
      ~ version_id           = "terraform-W97c8HtjP0m14x6LWqxm90VcMt" -> (known after apply)
      ~ version_stages       = [
          - "AWSCURRENT",
        ] -> (known after apply)
        # (4 unchanged attributes hidden)
    }

  # aws_secretsmanager_secret_version.erserver must be replaced
-/+ resource "aws_secretsmanager_secret_version" "erserver" {
      ~ arn                  = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/prod/app/erserver-EtWotp" -> (known after apply)
      + has_secret_string_wo = (known after apply)
      ~ id                   = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/prod/app/erserver-EtWotp|terraform-ihKfdfWUGK7lOed6EnD1bv3j2i" -> (known after apply)
      ~ secret_arn           = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/prod/app/erserver-EtWotp" -> (known after apply)
      ~ secret_string        = (sensitive value) # forces replacement
      ~ version_id           = "terraform-ihKfdfWUGK7lOed6EnD1bv3j2i" -> (known after apply)
      ~ version_stages       = [
          - "AWSCURRENT",
        ] -> (known after apply)
        # (4 unchanged attributes hidden)
    }

Plan: 3 to add, 1 to change, 2 to destroy.

@athvin athvin changed the title feat(prod): require verified PostgreSQL TLS feat(prod): enable verified TLS and the maintenance lock budget Nov 9, 2026
@athvin athvin mentioned this pull request Nov 9, 2026
4 of 6 tasks
@athvin
athvin force-pushed the issue/553-prod-tls-cutover branch from f54cb2e to 8c9b261 Compare November 9, 2026 03:21
@athvin
athvin force-pushed the issue/553-prod-tls-cutover branch from 8c9b261 to 799dd78 Compare November 9, 2026 03:48
@athvin
athvin force-pushed the issue/553-prod-tls-cutover branch 7 times, most recently from 343d8c7 to 2525a59 Compare November 10, 2026 19:06
@athvin
athvin force-pushed the issue/553-prod-tls-cutover branch from 2525a59 to 6907411 Compare November 17, 2026 04:15
Dropping the reader (#1096, PR #1099) made two rows in these references
false: prod Aurora is one Serverless v2 instance with no automatic
failover. That matters here specifically, because this PR's static
`max_locks_per_transaction` needs an instance reboot to activate — which
on a single instance is an outage rather than a failover.
@athvin

athvin commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto current main and re-verified. Still correctly draft — the
blockers are unchanged and are operator actions, not review feedback.

Why it was rebased, and what that avoided

The branch was six days stale and still carried the pre-#1099 form of
aws_rds_cluster_instance.prod:

count      = 2        # writer + reader
identifier = "er-prod-${count.index + 1}"

GitHub reported MERGEABLE/CLEAN because the hunks do not overlap textually,
so this would have merged quietly — and re-created the reader that #1096
removed for ~$43/month. After the rebase the resource is #1099's
for_each = toset(["er-prod-2"]) with its moved blocks, and this PR's
parameter group, both intact.

Confirmed against the fresh plan rather than inferred — plan (prod) at head
af5d43df:

# aws_rds_cluster.prod                       will be updated in-place
# aws_rds_cluster_parameter_group.prod       will be created
# aws_secretsmanager_secret_version.db       must be replaced
# aws_secretsmanager_secret_version.erserver must be replaced
Plan: 3 to add, 1 to change, 2 to destroy.

aws_rds_cluster_instance.prod does not appear in the plan at all, which is
the acceptance criterion: the single instance is untouched and no reader comes
back. The two destroys are the retired immutable secret versions, so a merge
needs ALLOW-DESTROY in the squash subject for tf-destroy-guard.sh.

All 15 required contexts pass at that exact head.

One thing has changed since this was written

The activation step — "restart the instances as required" — is no longer a
rolling failover.
#1096 (PR #1099) removed the reader, so prod Aurora is a
single instance: rebooting it to pick up the static
max_locks_per_transaction is a full database outage, not a failover to a
standby. That is a schedule question now, not just a procedure step.

I corrected two reference rows that #1096 had made false and that this PR
already touches — infrastructure.md's dev/prod comparison table claimed prod
was multi-AZ, and plan-to-aws.md §3.1 said the same.

What still blocks it

Unchanged from the description, and all of it off-limits to an agent session:

  1. the er/prod/app/erweb read-modify-write — the guard denies AWS mutations
    from a session that cannot prompt, which is the guard working as intended;
  2. the persisted org/dataset ER_LAKE_CATALOG DSNs copied at creation, which
    no secret update reaches;
  3. the reboot above;
  4. er maintain acceptance against prod Aurora.

Worth noting for whoever picks up (1): #1101 — ECR's "retain the last 30
images" is a ~1.5-day window, so confirm the tag prod is pinned to still exists
before relying on a workload reload.

And because this carries Closes #553, merging it would close the prod
environment epic while items 1–4 of its own acceptance remain unperformed. It
should stay draft until they are done.

@athvin
athvin marked this pull request as ready for review November 21, 2026 03:41
@athvin
athvin merged commit ec16e85 into main Nov 21, 2026
40 checks passed
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.

Prod environment — network, EKS, Aurora

2 participants