aws configure: Set Credentials and Region in CI
Store AWS CLI credentials, region, and output format - or skip it in CI in favor of OIDC roles.
aws configure writes an access key, secret key, default region, and output format to ~/.aws/credentials and ~/.aws/config. In CI you usually skip it and let short-lived OIDC role credentials flow in through environment variables instead. It remains the fastest way to set a region or one config value non-interactively.
Common flags
--profile NAME- read/write a named profile instead of defaultconfigure set KEY VALUE- write one value non-interactively (scriptable)configure get KEY- read one resolved valueconfigure list- print the resolved config and where each value came fromAWS_PROFILE(env) - select a profile without --profile
Example in CI
Set only the region; let OIDC supply credentials via env vars.
shell
aws configure set region us-east-1
aws configure set output jsonCommon errors in CI
- Unable to locate credentials - no key, profile, or role available; configure OIDC role auth
- The config profile (NAME) could not be found - --profile points at an undefined profile
- You must specify a region - no default region set and none passed
Key takeaways
- aws configure writes credentials, region, and output format to ~/.aws.
- Prefer
aws configure setfor scriptable, non-interactive config in CI. - In GitHub Actions, use OIDC role credentials instead of static keys.
Related guides
aws sts get-caller-identity: Verify AWS Auth in CIaws sts get-caller-identity returns the account, user, and ARN for the current credentials. Use it to verify…
aws sts assume-role: Assume an IAM Role in CIaws sts assume-role returns temporary credentials for a target role, enabling cross-account deploys. Learn th…
aws configure sso: Set Up IAM Identity Center Loginaws configure sso sets up an IAM Identity Center (SSO) profile for the AWS CLI. Learn the flags, an example,…