A developer is configuring a GitHub Actions workflow to deploy resources to an AWS account. To follow security best practices, the developer avoids using long-lived AWS credentials. Instead, they configure an OpenID Connect (OIDC) identity provider in IAM and create an IAM role named GitHubDeployRole to be assumed by the workflow.
The developer starts writing the following trust policy for the role, leaving two placeholders:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "________",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
"________": "repo:my-organization/my-repo:ref:refs/heads/main"
}
}
}
]
}
Which two values must the developer use to replace the placeholders to establish this trust relationship securely? (Select TWO.)
- Set the Action element to sts:AssumeRoleWithWebIdentityAnswer
- Set the second condition key to token.actions.githubusercontent.com:subAnswer
- CSet the Action element to sts:AssumeRole
- DSet the second condition key to aws:PrincipalArn
- ESet the Action element to sts:AssumeRoleWithSAML