Skip to content

Error: Not authorized to perform sts:AssumeRoleWithWebIdentity #318

Description

@shinebayar-g

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions