OIDC with AWS
- Getting started
- One-line setup (size labels)
- Which jobs can move
- Fallback & rollback
- Build cache (Nx / Turborepo)
- OIDC with AWS
- OIDC with Google Cloud
- Get started with your box
- GitLab (beta)
- Connect Claude (MCP)
- Billing
- Usage analytics & your data
- Data processors for Code review and Insights
- Help
OIDC lets a job get short-lived AWS credentials without storing an access key in GitHub. Each run asks GitHub for a signed token, and AWS swaps it for temporary credentials. The token flow is the standard GitHub Actions one, so the workflow below is the usual one with a compiler.dev runs-on label. For a longer walk-through, see GitHub Actions OIDC to AWS.
1. Add GitHub as an identity provider in IAM. Provider URL https://token.actions.githubusercontent.com, audience sts.amazonaws.com.
2. Create a role with this trust policy. Replace 111122223333, ORG and REPO. The sub condition is what keeps other repositories and branches out, so always set it.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "Federated": "arn:aws:iam::111122223333:oidc-provider/token.actions.githubusercontent.com" },
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
"token.actions.githubusercontent.com:sub": "repo:ORG/REPO:ref:refs/heads/main"
}
}
}]
}
3. Use the role in your workflow. The job needs id-token: write:
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: compiler-8cpu
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::111122223333:role/github-deploy
aws-region: eu-west-2
- run: aws sts get-caller-identity
- Which runs can assume the role: use
repo:ORG/REPO:ref:refs/heads/mainfor one branch,repo:ORG/REPO:environment:productionfor a GitHub environment, orStringLikewithrepo:ORG/REPO:*for the whole repository. - Pull requests from forks get no token, as on any runner.
- Your policy is yours: compiler.dev does not see or change your AWS roles. If a job cannot assume a role, the error comes from AWS; check the trust policy first.