Credentials
The AWS access key ID. Must be set together with
AWS_SECRET_ACCESS_KEY.Example: AKIAIOSFODNN7EXAMPLEThe AWS secret access key corresponding to
AWS_ACCESS_KEY_ID.Example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYThe session token for temporary credentials. Required when using short-lived credentials obtained via STS, SSO, or instance metadata.Example:
AQoXnyc4lcK4W4...ISO-8601 timestamp indicating when the credentials in the environment variables expire. When set, the SDK will re-invoke the credential provider before this time.Example:
2026-06-01T00:00:00ZRegion
The default AWS region for all SDK clients that do not have a region set explicitly in code. Takes precedence over
AWS_DEFAULT_REGION.Example: us-east-1Fallback region used when
AWS_REGION is not set. Recognized by the AWS CLI and some SDK components.Example: eu-west-1Profiles and config files
The named profile to load from
~/.aws/credentials and ~/.aws/config. Defaults to default when not set. Overridden by a profile value set directly on a client instance.Example: my-dev-profilePath to the shared AWS config file. Defaults to
~/.aws/config.Example: /etc/aws/configPath to the shared credentials file. Defaults to
~/.aws/credentials.Example: /etc/aws/credentialsWhen set to any truthy value, instructs the SDK to load configuration from
~/.aws/config in addition to ~/.aws/credentials. Node.js only.Example: 1Endpoint
Override the endpoint for all SDK clients. Useful when pointing to a local emulator such as LocalStack, or a custom VPC endpoint.Example:
http://localhost:4566Retries
The retry mode to use. Accepted values:
legacy— original SDK retry behaviorstandard— exponential backoff with jitter (default)adaptive— standard mode plus a token-bucket rate limiter
standardMaximum number of total attempts (initial request plus retries). Must be a positive integer.Example:
5Local development
Set credentials and region in your shell before running your application:aws sts assume-role), also export the session token:
CI/CD systems
Store credentials as encrypted secrets in your CI/CD platform and inject them as environment variables at runtime. Never hard-code credentials in pipeline configuration files.- GitHub Actions
- GitLab CI
- CircleCI
Store secrets under Settings → Secrets and variables → Actions, then reference them in your workflow:For GitHub Actions, the official
aws-actions/configure-aws-credentials action also supports OIDC-based role assumption without storing long-lived credentials.