aws-actions/configure-aws-credentials@v6

Configures AWS credentials for use in subsequent steps in a GitHub Action workflow

At a glance

Latest major
v6
Repository
aws-actions/configure-aws-credentials
Inputs
33 (1 required)
Outputs
5
Runs using
node24
License
MIT
Last checked

Inputs and outputs come straight from the action's official action.yml. See our editorial standards.

Usage

- uses: aws-actions/configure-aws-credentials@v6

Inputs

NameRequiredDefaultDescription
aws-regionYesnoneAWS Region, e.g. us-east-2
aws-profileNononeName of the AWS profile to configure. When provided, credentials are written to ~/.aws/credentials and ~/.aws/config files instead of env variables (unless output-env-credentials is manually set to true). Name cannot contain whitespace, square brackets, or slashes.
overwrite-aws-profileNononeOverwrite the given AWS profile if it already exists. Requires aws-profile. When set to false or not set, an error will be thrown if the profile already exists.
role-to-assumeNononeThe Amazon Resource Name (ARN) of the role to assume. Use the provided credentials to assume an IAM role and configure the Actions environment with the assumed role credentials rather than with the provided credentials.
aws-access-key-idNononeAWS Access Key ID. Provide this key if you want to assume a role using access keys rather than a web identity token.
aws-secret-access-keyNononeAWS Secret Access Key. Required if aws-access-key-id is provided.
aws-session-tokenNononeAWS Session Token.
web-identity-token-fileNononeUse the web identity token file from the provided file system path in order to assume an IAM role using a web identity, e.g. from within an Amazon EKS worker node.
role-chainingNononeUse existing credentials from the environment to assume a new role, rather than providing credentials as input.
audienceNosts.amazonaws.comThe audience to use for the OIDC provider
http-proxyNononeProxy to use for the AWS SDK agent
no-proxyNononeHosts to skip for the proxy configuration
mask-aws-account-idNononeWhether to mask the AWS account ID for these credentials as a secret value. By default the account ID will not be masked
role-duration-secondsNononeRole duration in seconds. Default is one hour.
role-external-idNononeThe external ID of the role to assume.
role-session-nameNononeRole session name (default: GitHubActions)
role-skip-session-taggingNononeSkip session tagging during role assumption
transitive-tag-keysNononeDefine a list of transitive tag keys to pass when assuming a role
inline-session-policyNononeDefine an inline session policy to use when assuming a role
managed-session-policiesNononeDefine a list of managed session policies to use when assuming a role
output-credentialsNononeWhether to set credentials as step output
output-env-credentialsNononeWhether to export credentials as environment variables. If you set this to false, you probably want to use output-credentials.
unset-current-credentialsNononeWhether to unset the existing credentials in your runner. May be useful if you run this action multiple times in the same job
disable-retryNononeWhether to disable the retry and backoff mechanism when the assume role call fails. By default the retry mechanism is enabled
retry-max-attemptsNononeThe maximum number of attempts it will attempt to retry the assume role call. By default it will retry 12 times
special-characters-workaroundNononeSome environments do not support special characters in AWS_SECRET_ACCESS_KEY. This option will retry fetching credentials until the secret access key does not contain special characters. This option overrides disable-retry and retry-max-attempts. This option is disabled by default
use-existing-credentialsNononeWhen enabled, this option will check if there are already valid credentials in the environment. If there are, new credentials will not be fetched. If there are not, the action will run as normal.
allowed-account-idsNononeAn option comma-delimited list of expected AWS account IDs. The action will fail if we receive credentials for the wrong account.
force-skip-oidcNononeWhen enabled, this option will skip using GitHub OIDC provider even if the id-token permission is set. This is sometimes useful when using IAM instance credentials.
action-timeout-sNononeA global timeout in seconds for the action. When the timeout is reached, the action immediately exits. The default is to run without a timeout.
custom-tagsNononeAdditional tags to apply to the assumed role session. Must be a JSON object provided as a string.
sts-endpointNononeCustom STS endpoint URL. Use this to point to an STS-compatible API instead of the default AWS STS endpoint for the region.
translate-env-variablesNononeWhether to translate AWS environment variables to action inputs. Defaults to true. Translating environment variables automatically may cause unexpected behavior if you have other actions that set AWS environment variables.

Outputs

NameDescription
aws-account-idThe AWS account ID for the provided credentials
aws-access-key-idThe AWS access key ID for the provided credentials
aws-secret-access-keyThe AWS secret access key for the provided credentials
aws-session-tokenThe AWS session token for the provided credentials
aws-expirationThe expiration time for the provided credentials

Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.

Examples

Assume a role with OIDC

Short-lived credentials from GitHub's OIDC token: no long-lived access keys in secrets.

name: Example
on:
  push:
    branches: [main]

permissions:
  id-token: write
  contents: read

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - name: "\"Configure AWS Credentials\" Action for GitHub Actions"
        uses: aws-actions/configure-aws-credentials@v6
        with:
          role-to-assume: "arn:aws:iam::123456789012:role/github-deploy"
          aws-region: us-east-1
      - run: aws sts get-caller-identity

Each example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.

Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.