Repository navigation
fix(infra): the prod deploy role may pull er-api layers for the launch gate (#1248) - #1249
Merged
Merged
Conversation
…h gate (#1248) The first gated prod deploy failed safely at fetching the checker: the role resolves digests but cannot pull layers, which docker create needs. GetDownloadUrlForLayer + BatchCheckLayerAvailability on the er-api repository only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
terraform plan
prod — 0 to add, 1 to changedata.aws_iam_policy_document.pod_trust: Reading...
module.network.data.aws_region.current: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
module.ses.data.aws_region.current: 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]
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_rds_engine_version.aurora_pg: 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_caller_identity.current: Reading...
data.aws_iam_policy_document.efs_csi_trust: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
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.eso_trust: Reading...
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.otel_collector: Reading...
data.aws_iam_policy_document.api_contract_bucket: Reading...
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=1193716550]
data.aws_iam_policy_document.api_contract_bucket: Read complete after 0s [id=1127163522]
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=2978074842]
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=81696635]
data.aws_caller_identity.current: Read complete after 1s [id=797781631727]
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.eso: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=2178872705]
data.aws_iam_policy_document.ci_deploy_prod_api_contract: Reading...
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.ci_deploy_prod_api_contract: Read complete after 0s [id=3801820449]
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=1033619361]
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_prod: Reading...
data.aws_iam_policy_document.ci_deploy_prod: Read complete after 0s [id=2891227359]
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_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:
~ update in-place
Terraform will perform the following actions:
# aws_iam_role_policy.ci_deploy_prod_api_contract will be updated in-place
~ resource "aws_iam_role_policy" "ci_deploy_prod_api_contract" {
id = "er-ci-deploy-prod:api-contract"
name = "api-contract"
~ policy = jsonencode(
~ {
~ Statement = [
{
Action = [
"s3:PutObject",
"s3:GetObject",
]
Effect = "Allow"
Resource = [
"arn:aws:s3:::er-prod-api-contract-797781631727/releases/*",
"arn:aws:s3:::er-prod-api-contract-797781631727/deployed/*",
]
},
+ {
+ Action = [
+ "ecr:GetDownloadUrlForLayer",
+ "ecr:BatchCheckLayerAvailability",
]
+ Effect = "Allow"
+ Resource = "arn:aws:ecr:us-east-2:797781631727:repository/er-api"
},
{
Action = "s3:ListBucket"
Condition = {
StringLike = {
"s3:prefix" = [
"deployed/*",
"releases/*",
]
}
}
Effect = "Allow"
Resource = "arn:aws:s3:::er-prod-api-contract-797781631727"
},
]
# (1 unchanged attribute hidden)
}
)
# (2 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
|
athvin
temporarily deployed
to
marketing-preview
November 26, 2026 01:45 — with
GitHub Actions
Inactive
This branch was previously deployed
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 #1248
What
er-ci-deploy-prodgainsecr:GetDownloadUrlForLayer+ecr:BatchCheckLayerAvailability, on theer-apirepository only, inapi-contract.tfbeside the gate's other grants.Why
#1248: post-merge fix-forward for #1247. The first gated prod deploy (run 45736789375) failed at Fetch the release's API checker with
not authorized to perform: ecr:GetDownloadUrlForLayer. The role could resolve digests but not pull layers. The failure was safe: the gate runs before the inactive colour is deployed, so production kept serving the previous release, and dev deployed normally.Proof
terraform fmt -checkandterraform validate(envs/prod): clean. The PR'sterraform plan (prod)must show 0 add, 1 change (the inline policy), 0 destroy. After the apply, re-running the failed prod job is the live proof.Risk & rollback
One inline-policy change; nothing is destroyed or replaced. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onMac· 2026-11-26T01:56:34Zmainis green with this change on it: merge8f4e939b. Push runs: rust 45737874823 success, frontend 45737874830 success, devcontainer 45737875008 success, infra 45737874733 success.images: n/a. Terraform only.deployconverged: n/a for the app. The change of record is the infra apply: run 45737874733apply (prod)gaveModifications complete [id=er-ci-deploy-prod:api-contract]andApply complete! Resources: 0 added, 1 changed, 0 destroyed.Live proof that the grant works: the re-run prod deploy's Fetch the release's API checker step succeeded, where attempt 1 had been refused.Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files