Terraform interview question
How do you configure OIDC authentication between GitHub Actions and AWS for Terraform pipelines?
How you'd do it Asked in DevOps Engineer · Cloud Engineer · Site Reliability Engineer (SRE) interviews
Summary
Create an aws_iam_openid_connect_provider for GitHub's OIDC endpoint and an IAM role
whose trust policy restricts the sub claim to a specific repository and environment.
The GitHub workflow uses aws-actions/configure-aws-credentials to assume the role with
no long-lived secrets.
Keep reading with a membership
The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.
More Terraform questions
- Terraform apply fails halfway through — some resources were created, others were not. How do you recover?
- What is Terraform, and how does it work at a high level?
- When do you need depends_on in Terraform, and when is it a code smell?
- What are the main terraform state subcommands, and when do you use them?
- Someone manually deletes an EC2 instance that Terraform manages. What happens on the next plan and apply?
- How should nonprod and production Terraform configurations differ, and how do you enforce those differences?
- How do you use Terraform to deploy the same infrastructure to nonprod and production AWS accounts?
- Walk through terraform init, plan and apply. What does each do?