I followed this documentation to setup my OIDC provider.
OIDC trust relationship doc:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::123456789:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "https://github.com/my-org"
}
}
}
]
}
Added permissions to workflow:
permissions:
id-token: write
contents: read # It wasn't mentioned on the docs, without this checkout action doesn't work!
Unfortunately Github Actions doesn't work. I'm getting:
Error: Not authorized to perform sts:AssumeRoleWithWebIdentity
What's the fix?
I followed this documentation to setup my OIDC provider.
OIDC trust relationship doc:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::123456789:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:aud": "https://github.com/my-org" } } } ] }Added permissions to workflow:
Unfortunately Github Actions doesn't work. I'm getting:
What's the fix?