Skip to content

How does GitHub deploy to AWS without stored AWS keys?

1 min read · main part only; folded sections are optional

After this you can answer: How does GitHub deploy to AWS without stored AWS keys?

There are two questions: who may assume the role, and what that role may do. The trust conditions require the AWS audience and the expected GitHub subject. The publish job needs id-token: write to request the token; that permission does not grant repository write access.

A job using a GitHub environment has an environment-shaped subject rather than the ordinary branch subject. MiniTickets matches the deploy environment to the Pulumi stack. The deploy role is broader than the ECR publish role because it applies infrastructure.

An environment subject alone does not prove which branch or workflow produced it. Branch restrictions, required reviewers and self-review rules need their own protection settings. The repository bootstrap currently permits self-review; that limitation is documented rather than treated as a completed hardening step. I would also review third-party action pinning and what executable code runs after credentials become available.

Why does AssumeRoleWithWebIdentity fail before an ECR call?
The trust exchange failed, so ECR permissions are not yet relevant. Compare issuer, audience and subject with the live trust policy.
Does OIDC make the deploy role harmless?
No. Temporary credentials can still exercise every permission the role grants while valid. Limit scope and protect the workflow.
Could another workflow use the environment role?
Potentially, if it can run with the matching environment subject and satisfy its protection settings. The subject is not a workflow identity.

Read the path chapter, select the relevant map piece →, then inspect infra/src/cicd.ts → createCicd. Work through the related case for a diagnostic example.

Read this book online: https://book.theversehub.in/