OpenID Connect (OIDC) is often used in CI/CD pipelines. What is its main purpose?
Think about how pipelines avoid using static secrets.
OIDC allows CI/CD jobs to authenticate dynamically using short-lived tokens, avoiding the need to store static credentials.
Given this Terraform code snippet, what will be the value of aws_iam_openid_connect_provider.example.url after apply?
resource "aws_iam_openid_connect_provider" "example" { url = "https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B716D3041E" client_id_list = ["sts.amazonaws.com"] thumbprint_list = ["9e99a48a9960b14926bb7f3b02e22da0afd6e1e4"] }
Look at the url attribute in the resource.
The url attribute is set explicitly to the OIDC provider URL string.
Choose the Terraform assume_role_policy JSON that correctly allows OIDC authentication from a specific provider.
Look for the correct Principal and Action for OIDC.
The trust policy must allow sts:AssumeRoleWithWebIdentity for the correct OIDC provider ARN and include conditions for the service account.
Given this snippet from a GitHub Actions workflow, why does the AWS CLI command fail with 'AccessDenied'?
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::123456789012:role/GitHubOIDCRole
aws-region: us-west-2
- name: Deploy
run: aws s3 lsCheck the IAM role trust policy for OIDC provider permissions.
If the IAM role's trust policy does not include GitHub's OIDC provider ARN, the role assumption will fail with AccessDenied.
Arrange these steps in the correct order to set up OIDC authentication for a CI/CD pipeline that deploys to AWS.
Think about setting up AWS first, then configuring the pipeline to use it.
First, create the OIDC provider in AWS (1), then create the IAM role trusting that provider (3). Next, configure the pipeline to request tokens (2), and finally assume the role (4).