Repository navigation
feat(infra): delete the static S3 lake key, which had no consumer (#549) - #791
Merged
Merged
Conversation
This was referenced Nov 7, 2026
Contributor
terraform plan
Warning This plan DESTROYS resources in: dev. Merging applies it unattended. dev — 0 to add, 0 to change, 5 to DESTROYdata.aws_iam_policy_document.eso_trust: Reading...
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.eso_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.efs_csi_trust: Reading...
data.aws_rds_engine_version.aurora_pg: Reading...
module.network.data.aws_region.current: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.obs_pod_trust: 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.er_api_pod_trust: Reading...
data.aws_caller_identity.current: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.network.data.aws_availability_zones.available: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Read complete after 0s [id=819195744]
data.aws_region.current: Reading...
data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.eso: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=1725605485]
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=4006586444]
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=2205495074]
data.aws_iam_policy_document.otel_collector: Reading...
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=3111493560]
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=3442692123]
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.bedrock_invoke: Reading...
data.aws_iam_policy_document.bedrock_invoke: Read complete after 0s [id=3601248236]
module.network.data.aws_availability_zones.available: Read complete after 1s [id=us-east-2]
data.aws_rds_engine_version.aurora_pg: Read complete after 1s [id=17.9]
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 1s [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:
# aws_iam_access_key.s3 will be destroyed
# (because aws_iam_access_key.s3 is not in configuration)
- resource "aws_iam_access_key" "s3" {
- create_date = "2026-10-10T21:17:07Z" -> null
- id = "AKIA3TP35ULXQQYDISZZ" -> null
- secret = (sensitive value) -> null
- ses_smtp_password_v4 = (sensitive value) -> null
- status = "Active" -> null
- user = "er-dev-s3" -> null
}
# aws_iam_user.s3 will be destroyed
# (because aws_iam_user.s3 is not in configuration)
- resource "aws_iam_user" "s3" {
- arn = "arn:aws:iam::797781631727:user/er-dev-s3" -> null
- force_destroy = false -> null
- id = "er-dev-s3" -> null
- name = "er-dev-s3" -> null
- path = "/" -> null
- tags = {} -> null
- tags_all = {
- "Environment" = "dev"
- "ManagedBy" = "terraform"
- "Project" = "entity-resolution"
} -> null
- unique_id = "AIDA3TP35ULXUPLD4NN54" -> null
# (1 unchanged attribute hidden)
}
# aws_iam_user_policy.s3 will be destroyed
# (because aws_iam_user_policy.s3 is not in configuration)
- resource "aws_iam_user_policy" "s3" {
- id = "er-dev-s3:er-dev-lake" -> null
- name = "er-dev-lake" -> null
- policy = jsonencode(
{
- Statement = [
- {
- Action = [
- "s3:PutObject",
- "s3:ListMultipartUploadParts",
- "s3:GetObject",
- "s3:DeleteObject",
- "s3:AbortMultipartUpload",
]
- Effect = "Allow"
- Resource = "arn:aws:s3:::er-dev-lake-797781631727/*"
- Sid = "LakeObjects"
},
- {
- Action = [
- "s3:ListBucketMultipartUploads",
- "s3:ListBucket",
- "s3:GetBucketLocation",
]
- Effect = "Allow"
- Resource = "arn:aws:s3:::er-dev-lake-797781631727"
- Sid = "LakeList"
},
- {
- Action = [
- "kms:GenerateDataKey*",
- "kms:Decrypt",
]
- Effect = "Allow"
- Resource = "arn:aws:kms:us-east-2:797781631727:key/0c226b8f-de72-4f5f-b50b-0cf1391bc325"
- Sid = "LakeKey"
},
]
- Version = "2012-10-17"
}
) -> null
- user = "er-dev-s3" -> null
# (1 unchanged attribute hidden)
}
# aws_secretsmanager_secret.s3 will be destroyed
# (because aws_secretsmanager_secret.s3 is not in configuration)
- resource "aws_secretsmanager_secret" "s3" {
- arn = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/dev/shared/s3-Y47I6B" -> null
- description = "The 9.2 interim lake credential; consumed by scripts/dev_env.sh. Phase 4 retires it." -> null
- force_overwrite_replica_secret = false -> null
- id = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/dev/shared/s3-Y47I6B" -> null
- name = "er/dev/shared/s3" -> null
- recovery_window_in_days = 30 -> null
- region = "us-east-2" -> null
- tags = {} -> null
- tags_all = {
- "Environment" = "dev"
- "ManagedBy" = "terraform"
- "Project" = "entity-resolution"
} -> null
# (4 unchanged attributes hidden)
}
# aws_secretsmanager_secret_version.s3 will be destroyed
# (because aws_secretsmanager_secret_version.s3 is not in configuration)
- resource "aws_secretsmanager_secret_version" "s3" {
- arn = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/dev/shared/s3-Y47I6B" -> null
- id = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/dev/shared/s3-Y47I6B|terraform-v7xxtO3mes7ucCqcdvguiO5Ipp" -> null
- region = "us-east-2" -> null
- secret_arn = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/dev/shared/s3-Y47I6B" -> null
- secret_id = "arn:aws:secretsmanager:us-east-2:797781631727:secret:er/dev/shared/s3-Y47I6B" -> null
- secret_string = (sensitive value) -> null
- secret_string_wo = (write-only attribute) -> null
- version_id = "terraform-v7xxtO3mes7ucCqcdvguiO5Ipp" -> null
- version_stages = [
- "AWSCURRENT",
] -> null
# (1 unchanged attribute hidden)
}
Plan: 0 to add, 0 to change, 5 to destroy.
|
#549 asked to move DuckDB and boto3 onto the credential chain. Neither half exists: the Python tree that held boto3 was deleted, and the Rust engine has no object-store path to migrate — no httpfs/aws load, no CREATE SECRET, no ER_S3_* reader (the ducklake-lakehouse skill pins this, and attach-and-tenancy.md records building one as still-not-on-main). So the key was not a credential in use. It was minted in lake.tf, written to er/dev/shared/s3, and read by nothing: no Rust reader, no chart injection, dev_env.sh reads only shared/postgres, and the `secret://` indirection meant to resolve it belonged to Python's deleted secrets.py. Meanwhile the identical grants already sit on the er-dev-runner-pod Pod Identity role, which pod_identity.tf said in-line was where credential-chain access "already lives", and the one real S3 client (s3_ingest::Watcher) has always used the default chain. Retiring it is therefore a deletion, which is #549's own narrowed acceptance check: aws_iam_access_key blocks drop from 2 to 1, and the survivor is builder. The policy document survives the user it described, renamed lake_access. Also removes the dead ER_S3_*/secret:// tenant env and ERSERVER_SECRET_S3_* pair from dev_env.sh, and corrects four references that still presented the key as the live mechanism — including two that cited deleted src/er/lake/*.py files as current, and one that gave the builder key a scheduled deletion it does not have. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
#549's acceptance check was a count — `aws_iam_access_key` blocks under infra/terraform/ drop from 2 to 1, survivor `builder`. A count in a closed issue protects nothing, so this is that check as a gate, plus a bar on re-plumbing the ER_S3_* pair the previous commit removed (the engine has no reader for it, so re-adding it could only recreate a credential nothing uses). The gate carries a FLOOR, which is the part worth reviewing: against the real tree, finding ZERO access-key blocks exits 2 rather than reporting success, because builder.tf is known to declare one. A detector breaks by noticing nothing, and that failure reads exactly like a clean tree — the shape that let the S9 pin gate enforce nothing until #467. Its self-test asserts both directions of both rules, proves the floor fires, and fails if it asserted fewer than nine cases. Both findings the self-test produced on first run were real: the gate flagged its own REJECT fixtures (now exempted by exact path, not a *-test.sh glob), and the harness was pointing rule 2 at a directory the terraform fixture was not in, so that case had been asserting nothing. Wired into `make check` and rust.yml's ungated `workflow pins (S9)` job, beside its siblings — a new access key arrives on an infra-only PR, which is precisely what a Rust path filter skips. footprint.md's AWS inventory is regenerated here and is load-bearing as corroboration: it now independently reads 1 aws_iam_access_key, 1 aws_iam_user, 1 aws_iam_user_policy and 4 aws_secretsmanager_secret — each down one — from a generator that knows nothing about this ticket. An earlier revision of this commit also carried a CLAUDE.md skill-table regen, because a241585 ("enable skill") had edited claim-ticket's frontmatter without regenerating it and `main` was failing `make skills-check` independently of this branch. 6d04e4b has since landed that same regen, so the rebase dropped it and this commit no longer touches CLAUDE.md. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
force-pushed
the
issue/549-s3-credential-chain
branch
from
November 7, 2026 20:11
2e6041b to
b5c3dcf
Compare
athvin
marked this pull request as ready for review
November 7, 2026 20:12
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #549
What the tree says, against what the ticket says
The ticket asks for "DuckDB
credential_chainplus the boto3 default chain".Neither half is reachable as written, and the reason changes the scope:
phrasing from
plan-to-aws.md, written when the implementation was Python.dedupe_core::sessionhas no
httpfs/awsload, noCREATE SECRETand noER_S3_*reader —.claude/skills/ducklake-lakehouse/SKILL.mdpins this as a fact, andreferences/attach-and-tenancy.mdrecords building one as still-not-on-mainin-flight work. So
credential_chainis not a switch to flip; it is a featurethat does not exist yet.
What that leaves is smaller and cleaner than the ticket implies: the static
key has no consumer at all. Verified each path:
ER_S3_*rust/crates/er-serverreadsERSERVER_SECRET_S3_*/secret://secrets.py, deletedER_S3_*scripts/dev_env.shconsumeser/dev/shared/s3shared/postgres; the s3 entry is read by nothingpod_identity.tf:106already attaches the identical policy document to theer-dev-runner-podrole, and says in-line that this is where credential-chain access "already lives"s3_ingestneeds the keys3_ingest.rs:230says so explicitly)So the ticket's own narrowed acceptance check —
aws_iam_access_keyblocks dropfrom 2 to 1, and the surviving one is
builder— is the whole achievabledeliverable, and it is a deletion rather than a migration.
Plan
infra/terraform/envs/dev/lake.tf— deleteaws_iam_user.s3,aws_iam_user_policy.s3,aws_iam_access_key.s3,aws_secretsmanager_secret.s3and its..._version. Keep the policydocument (the runner role uses it) renamed
s3_user→lake_access,since there is no user left for it to describe. Rewrite the header comment
that currently calls the key a live Phase-1 credential.
infra/terraform/envs/dev/pod_identity.tf— repoint to the renameddocument and correct the comment: the service user has retired, so
"when that user retires" is no longer a future tense.
scripts/dev_env.sh— drop the deadER_S3_*/secret://tenantenv, the
ERSERVER_SECRET_S3_*pair, theER_DEV_S3_KEYwarning and theheader docs for both, all of which describe a Python resolver that is gone.
mode my notes call skills rot at borrowed identifiers:
.claude/skills/infra-platform/references/infrastructure.md(§467 citestwo deleted
src/er/lake/*.pyfiles as current),.claude/skills/aws-account-operations/references/bedrock-and-sdks.md(table row names "the static
ER_S3_*key" as the lake's credential), and.claude/skills/er-engine-ops/references/configuration.md(documentsER_S3_*as env the CLI reads).builder.tf's "should still be removed"line goes too — Retire the S3 service access key in favour of the credential chain #549 records the builder key as permanent.
scripts/ci/tf-static-credentials-check.shasserting exactly one
aws_iam_access_keyunderinfra/terraform/andthat it is
builder, with its own self-test first (a detector that breaksby noticing nothing reads like a clean tree). Wired into
make checkandrust.yml's ungated
workflow pins (S9)job beside the sibling checks.Out of scope, and it needs its own ticket: the actual object-store
credential path (optional-field config →
CREATE OR REPLACE SECRETwhere anabsent key selects the chain, plus the filter keeping credential-shaped values
out of org rows). That is the in-flight feature
attach-and-tenancy.mddescribes, it is not what #549's acceptance check measures, and it is the thing
that would make an
s3://lake open from Rust. Filed as #792, with both ofthat document's in-flight bullets as its acceptance criteria.
Gates
make check(touchesscripts/, a workflow and skill references, soscripts-home-check,workflow-shell-checkandskills-checkall bear on it),plus
terraform validate/fmtvia the infra tier, and the new guard observedfailing before it is trusted.
Merge note: this plans a non-zero destroy, so
tf-destroy-guard.shrefusesit without the token — merge with
gh pr merge 791 --squash --subject '<subject> ALLOW-DESTROY'.What changed while implementing
Three things the plan did not predict, all worth reading before the diff:
builder.tfnowsays "REMOVAL — NOT SCHEDULED. Kept indefinitely by owner decision", and
docs/parity-roadmap.mdis gone with the wholedocs/directory. So step 4went looking elsewhere and found worse:
bedrock-and-sdks.mdwas stillgiving the builder key "a scheduled deletion before the production gate",
which is the opposite of the recorded decision, and
infrastructure-decisions.mdcited threeER_S3_REGIONsites of which nonestill sets it.
REJECT fixtures, and the self-test was pointing rule 2 at a directory the
terraform fixture was not in, so that case had been asserting nothing. Both
fixed; the commit message records them rather than hiding a clean first run.
mainwas already red onmake checkbefore this branch existed.a241585b("enable skill") editedclaim-ticket's frontmatter withoutregenerating CLAUDE.md's generated skill table, so this branch originally
carried that one regenerated line in order to go green. It no longer does:
6d04e4b3has since landed the identical regen, the rebase onto it droppedmine, and the commit message was amended to stop describing a change it no
longer contains. This PR now touches neither CLAUDE.md nor
agent-skills.md.Independent corroboration of the acceptance check, from a generator that does
not know about this ticket:
footprint.md's AWS resource inventory isregenerated by
skills-checkfrom the Terraform tree, and now reads1 aws_iam_access_key,1 aws_iam_user,1 aws_iam_user_policyand4 aws_secretsmanager_secret— each down one.Verification
make checkrun to completion against this branch, then every non-compilinggate re-run after the rebase onto
6d04e4b3:fmt,clippy -D warnings,doc -D warningsentities-checkskills-checkscripts-home-checkworkflow-shell-checktf-static-credentials-check1 access key(s), all allowedtesttest result: ok, zeroFAILEDterraform fmt -check -recursiveThe gate was observed failing before being trusted — it rejected its own
fixtures and exposed a self-test case that was asserting nothing. Both fixed in
the same commit.