AWS › AWS CLI & SDKs
How do you configure authentication credentials for the AWS CLI to securely access your AWS account?
BeginnerAnswer
You typically configure the AWS CLI using the aws configure command, which stores your access key ID and secret access key in a local credentials file, though best practice recommends using named profiles for different accounts or roles, and increasingly, using temporary credentials obtained through IAM Identity Center or assumed roles rather than long lived access keys, to reduce the security risk of leaked credentials.
aws configure --profile productionReal-world example A consultant working with multiple client AWS accounts sets up a separate named profile for each client using aws configure, allowing them to easily switch between accounts using the --profile flag without needing to reconfigure credentials each time.