Repository navigation
Conversation
…work SSM GetParameters returns the plain parameter name even when an ARN was requested, so lookups by ARN (cross-account parameters shared through RAM) missed and the GitHub App credentials store failed with "not found". Map each returned parameter back to the requested entry that equals its Name or ARN. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
RamonGal
marked this pull request as ready for review
November 17, 2026 00:44
This branch has not been 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.
Description
Fixes the scale-up Lambda failing with
Parameter arn:aws:ssm:us-east-1:111111111111:parameter/github-runners/app/id not foundwhen the GitHub App SSM parameters live in another account and are shared through RAM, so the module is configured with their ARNs.Use case
Self-hosted runners run in a VPC so that jobs can reach a private EKS API endpoint. One GitHub App serves several clusters, so its credentials live in one central account and are shared with each cluster account through AWS RAM. Each cluster account deploys this module and passes the shared parameter ARNs in
github_app.flowchart LR GH["GitHub App<br/>workflow_job webhook"] --> WH subgraph SHARED["Central account"] PARAMS[("SSM parameters<br/>App id, private key, webhook secret")] RAM{{"RAM share"}} PARAMS --- RAM end subgraph CLUSTER["Cluster account, runner module"] WH["Webhook Lambda<br/>reads one parameter"] SQ[["Build queue"]] SU["Scale-up Lambda<br/>GetParameters by ARN"] WH --> SQ --> SU subgraph VPC["VPC, private subnets"] RUN["Self-hosted runner<br/>EC2"] EKS["EKS cluster<br/>private API endpoint"] RUN -->|"kubectl, helm, terraform"| EKS end SU -->|"launches"| RUN end RAM -. "shared with cluster account" .-> WH RAM -. "shared with cluster account" .-> SU SU == "App id and private key by ARN: Name returned is the plain name, lookup by ARN misses" ==> PARAMSWithout the App credentials the scale-up Lambda cannot create a registration token or JIT config, so no runner starts and jobs that need the private cluster wait forever. The webhook Lambda is not affected because it reads a single parameter and uses its value directly.
Affects module v8.1.0 and v8.1.1 (same code). The batch
GetParameterscall comes from #5017; v7.11.0 already uses the batch call.Cause:
getParameterskeyed its result by theNamefield of each returned parameter. For an ARN request SSM returns the plain name (/github-runners/app/id) inNameand the full ARN inARN, soparameters.get(<ARN>)in the credentials store missed. It is not a permissions problem: the RAM share is active, CloudTrail shows a successfulkms:Decryptby the scale-up role, andget-parametersreturns the plainNamewith noInvalidParameters.Fix: in
lambdas/libs/aws-ssm-util/src/index.ts,getParametersnow keys the map by the requested strings. A returned parameter matches a requested entry when the entry equals itsNameorARN. Matching is per 10-name chunk, duplicates do not change the result, and requested entries SSM does not return (missing orInvalidParameters) stay absent. Parameters with an emptyValuestay omitted, as before. Callers are unchanged; this also fixes the matcher config store, ami-housekeeper and the scale-set parameter store, which all look results up by the requested name.getParameter(Powertools) already works with ARNs.Test Plan
lambdas/libs/aws-ssm-util/src/index.test.ts: ARN request, mixed names and ARNs, missing/invalid entries, duplicates, chunking (12 names with ARNs, reversed response order), empty value.lambdas/libs/storage-providers/aws/ssm/github-app-credentials-store.arn.test.ts: realgetParameterswith the SSM client mocked, ARNs inPARAMETER_GITHUB_APP_ID_NAMEandPARAMETER_GITHUB_APP_KEY_BASE64_NAME. The new ARN tests fail onmainand pass on this branch.yarn format-check,yarn lint,yarn testandyarn buildpass fromlambdas/.Related Issues
Fixes #5595
🤖 Generated with Claude Code