Example trustpolicy.json
. Make sure to replace AWS_ACCOUNT_ID
and GITHUB_ORG
with your own values.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::AWS_ACCOUNT_ID:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringLike": {
"token.actions.githubusercontent.com:sub":
"repo:GITHUB_ORG/*"
},
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
}
}
}
]
}
AWS_ACCOUNT_ID
Replace AWS_ACCOUNT_ID
with your AWS Account ID that you want to authenticate against. This can be found using
the following command:
aws sts get-caller-identity
GITHUB_ORG
Replace GITHUB_ORG
with your GitHub Organization you want to grant access to against your
AWS account.