Repository navigation
fix(infra): grant PlatformReadOnly a view access entry on er-dev (#839) - #844
Merged
Merged
Conversation
The eks module created access entries for admin principals only, so the er-readonly profile's SSO role got a 401 from the cluster despite healthy IAM. Add a viewer_principal_arns map wired to an access entry with AmazonEKSViewPolicy (cluster scope, no Secret contents) and pass the materialized PlatformReadOnly role ARN from envs/dev. Regenerate the AWS footprint reference for the two resource-type count changes.
Contributor
terraform plan
dev — 2 to add, 0 to changemodule.network.data.aws_region.current: Reading...
data.aws_region.current: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
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]
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_openid_connect_provider.github: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Reading...
data.aws_rds_engine_version.aurora_pg: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_caller_identity.current: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.eso: Reading...
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.obs_pod_trust: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
module.network.data.aws_availability_zones.available: Reading...
data.aws_iam_policy_document.obs_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.eso: Read complete after 0s [id=1725605485]
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=4006586444]
data.aws_iam_policy_document.otel_collector: Reading...
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=3111493560]
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_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.bedrock_invoke: Reading...
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.bedrock_invoke: Read complete after 0s [id=3601248236]
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=3442692123]
data.aws_rds_engine_version.aurora_pg: Read complete after 1s [id=17.9]
module.network.data.aws_availability_zones.available: Read complete after 1s [id=us-east-2]
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]
data.aws_iam_policy_document.ci_deploy_dev: Reading...
data.aws_iam_policy_document.ci_deploy_dev: Read complete after 0s [id=1754478413]
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.eks.aws_eks_access_entry.viewer["platform_readonly"] will be created
+ resource "aws_eks_access_entry" "viewer" {
+ access_entry_arn = (known after apply)
+ cluster_name = "er-dev"
+ created_at = (known after apply)
+ id = (known after apply)
+ kubernetes_groups = (known after apply)
+ modified_at = (known after apply)
+ principal_arn = "arn:aws:iam::797781631727:role/aws-reserved/sso.amazonaws.com/us-east-2/AWSReservedSSO_PlatformReadOnly_32bd506ae970d37d"
+ region = "us-east-2"
+ tags_all = {
+ "Environment" = "dev"
+ "ManagedBy" = "terraform"
+ "Project" = "entity-resolution"
}
+ type = "STANDARD"
+ user_name = (known after apply)
}
# module.eks.aws_eks_access_policy_association.viewer["platform_readonly"] will be created
+ resource "aws_eks_access_policy_association" "viewer" {
+ associated_at = (known after apply)
+ cluster_name = "er-dev"
+ id = (known after apply)
+ modified_at = (known after apply)
+ policy_arn = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy"
+ principal_arn = "arn:aws:iam::797781631727:role/aws-reserved/sso.amazonaws.com/us-east-2/AWSReservedSSO_PlatformReadOnly_32bd506ae970d37d"
+ region = "us-east-2"
+ access_scope {
+ type = "cluster"
}
}
Plan: 2 to add, 0 to change, 0 to destroy.
|
athvin
marked this pull request as ready for review
November 8, 2026 08:02
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 #839
What
Grants the
PlatformReadOnlySSO permission-set role a cluster-scoped EKS access entry withAmazonEKSViewPolicyoner-dev, via a newviewer_principal_arnsvariable on theeksmodule.Why
kubectlaser-readonlygets a 401 from the cluster even though the IAM side is healthy: the module created access entries for admins but none for read-only identities. Deploy verification (kubectl get pods, log fetches) is documented as a read-only-profile operation and cannot work without this entry.Proof
AWS_ACCESS_KEY_ID=test … bash scripts/ci/tf-validate-all.sh→ "Success! The configuration is valid." for every env.scripts/skills-check.sh regenupdated the generated AWS footprint (the two access-resource types move 1→2). The behavioral proof is post-merge: the apply creates the entry andkubectl --context er-dev-ro get pods -Astops 401ing.Risk & rollback
Additive only — a new access entry and policy association; nothing existing is touched. Worst case the read-only role sees more of the cluster than intended, but
AmazonEKSViewPolicyreads no Secret contents, matching the AWS-sideReadOnlyAccessposture. Rollback:git revert <merge-sha>and re-apply, or remove the access entry by hand.Post-merge ledger
Closed by: agent · session
01a1b892-4cde-7a53-bb3e-9ed2e764acdconMac· 2026-11-08T08:18:38Zmainis green with this change on it — merge SHAf2568e17; allfour push runs success: infra 42461288374 (incl. apply core/dev/prod),
rust 42461288368, frontend 42461288375, devcontainer 42461288348:
images— n/a: infra-only diff, no image inputs changed; the imagesworkflow correctly never ran (absent from the merge SHA's run list):
deploy— for an infra change the apply IS the deploy: infra run42461288374
apply (dev)success created the access entry; no app/chartchange, so no app deploy was owed. Convergence proof below:
(run 42461288374); drift latest 42453080846 success; kind nightly leg
latest 42455973323 success. Nothing red for a reason that is this change:
Donethrough the automation (verified viaGraphQL
projectItems), and er-dev rejects the er-readonly identity with 401 — EKS access entry drift suspected #839 closed COMPLETED on merge:aws-account-operations); nothing else deferred:
failure mode is recorded in the module comment at
infra/terraform/envs/dev/eks.tfand filed as skill: document the EKS 401-despite-healthy-IAM failure mode in aws-account-operations #846 for theaws-account-operations skill:
Specific to this change
kubectl --context er-dev-roworks — post-apply,kubectl --context er-dev-ro -n ci get podsreturns the namespace's pods (er-dispatcher, web-api-blue, er-tenant-drift) instead ofUnauthorized. The ticket's acceptance, proven.Context — plan, discoveries, measurements, files
Plan
er-readonlyto distinguish gap from drift. ✅viewer_principal_arns(map, default{}) to theeksmodule, wired toaws_eks_access_entry+aws_eks_access_policy_associationwithAmazonEKSViewPolicyat cluster scope. ✅PlatformReadOnlyrole ARN fromenvs/dev. ✅kubectl --context er-dev-roreads.Discoveries
aws eks list-access-entries --cluster-name er-dev(profileer-readonly) lists entries forAdministratorAccessandPlatformAdminbut noPlatformReadOnlyentry — the 401 is a coverage gap in the module, not drift of an existing entry.admin_principal_arnsmap feeding identical resources withAmazonEKSClusterAdminPolicy; the fix mirrors that shape for viewers rather than inventing a second pattern.AmazonEKSViewPolicyexcludes Secret contents, which is the match for the AWS-sideReadOnlyAccessmanaged policy the permission set carries.Measurements
aws eks list-access-entries --cluster-name er-dev --profile er-readonly→ 2 entries (AdministratorAccess,PlatformAdmin), neither covering thePlatformReadOnlyrole ARN.kubectl --context er-dev-ro -n ci get pods→error: You must be logged in to the server (Unauthorized)before this change.Files
infra/terraform/modules/eks/main.tf— newviewer_principal_arnsvariable +vieweraccess entry and policy association.infra/terraform/envs/dev/eks.tf— passes the materializedPlatformReadOnlySSO role ARN..claude/skills/aws-account-operations/references/footprint.md— regenerated (generated block; the two access-resource types move 1→2).