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.
More on CI/CD and Automation
Why run Terraform from a pipeline instead of laptops?BeginnerWhat stages does a good Terraform pull-request pipeline have?BeginnerHow do you make sure the apply runs exactly what was reviewed?IntermediateHow do you serialize applies to the same stack in CI?AdvancedShow a minimal GitHub Actions workflow for plan on PR.BeginnerWhat is Atlantis and how does the flow work?Beginner