Interview Prep/Terraform/CI/CD and Automation

How does OIDC authentication from GitHub Actions to AWS work?

IntermediateProductionCI/CD and Automation
Answer

You create an IAM OIDC identity provider for token.actions.githubusercontent.com and a role whose trust policy allows sts:AssumeRoleWithWebIdentity with conditions on sub (for example repo:acme/infra:ref:refs/heads/main or repo:acme/infra:environment:prod) and aud (sts.amazonaws.com). The workflow requests a short-lived token (id-token: write) and exchanges it for credentials. No secrets stored in GitHub.

All Terraform questions Roadmap: Terraform in production

More on CI/CD and Automation