Skip to content

feat(webhook-github-app): read the GitHub App key from SSM - #5601

Open
jukr-stellar wants to merge 4 commits into
github-aws-runners:mainfrom
stellarhealth:webhook-github-app-key-ssm
Open

jukr-stellar wants to merge 4 commits into
github-aws-runners:mainfrom
stellarhealth:webhook-github-app-key-ssm

Conversation

@jukr-stellar

Copy link
Copy Markdown

Adds github_app.key_base64_ssm to webhook-github-app, matching the input of the same name on the root and multi-runner modules. When set, update-app.sh reads the key from SSM with the AWS CLI when it runs, so the key never appears in plan or state.

Why

The root and multi-runner modules already accept key_base64_ssm, so the runners can use a private key that lives only in an externally managed SecureString. webhook-github-app still requires the raw key as a string. Any deployment that uses it has to keep a copy of the key in code or variables, and that copy ends up in state. That defeats the point of the SSM input. GitHub's guidance is to keep App private keys in a secret store and never hard-code them. This change lets the whole module set follow it.

Changes

  • key_base64 becomes optional. key_base64_ssm takes precedence when both are set, as in the root module.
  • New optional ssm_assume_role_arn. The script runs with the shell's credentials, not the AWS provider's. When those differ, for example when the provider assumes a role, the script assumes this role for the SSM read only.
  • update-app.sh gains -p (SSM parameter ARN) and -r (role ARN), both also readable from the environment. The region comes from the ARN.
  • The module now passes its values to the script as environment variables instead of command-line flags, which keeps the private key out of the process list.
  • No change to the Terraform floor or providers. The SSM ARN and role are added to triggers only when set, so callers using key_base64 see no change on upgrade. Switching to SSM runs the webhook update once, which surfaces a broken SSM read right away.

id and webhook_secret don't get *_ssm variants here. They could follow the same pattern if wanted.

🤖 Generated with Claude Code

jukr-stellar and others added 3 commits November 18, 2026 16:09
Add github_app.key_base64_ssm, read through the AWS provider's
ephemeral aws_ssm_parameter so the key stays out of plan and state.
Pass the key, App ID, endpoint, and secret to update-app.sh as
environment variables instead of command-line flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rm 1.5.6

Replace the ephemeral aws_ssm_parameter with an AWS CLI read in
update-app.sh, so the module keeps its Terraform 1.5.6 floor and only
calls AWS when the webhook update runs. Add ssm_assume_role_arn for
shells whose credentials differ from the provider's. key_base64_ssm
now takes precedence over key_base64, matching the root module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- testCommand exits 1 instead of 0 when a required tool is missing
- assume-role uses the region from the parameter ARN
- validate that key_base64_ssm.arn is an SSM parameter ARN
- trigger a webhook update when the SSM inputs change; the trigger
  keys are only added when set, so key_base64 callers are unaffected
- share one get-parameter call between the role and no-role paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jukr-stellar
jukr-stellar marked this pull request as ready for review November 19, 2026 03:56
@jukr-stellar
jukr-stellar requested a review from a team as a code owner November 19, 2026 03:56

This branch has not been deployed

No deployments
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.

1 participant