Configuring AWS profile settings for the Command Line Interface (CLI) provides users with flexibility and control over their interactions with AWS services. One common method is through the AWS CLI configuration command, “aws configure,” which prompts users to input their Access Key ID, Secret Access Key, default region, and output format. This straightforward approach is suitable for basic configurations.
Alternatively, users can manually edit the AWS CLI1 configuration files, typically located in the “~/.aws” directory. The “credentials” file stores access keys, while the “config” file contains region and output format information. This method allows for more advanced configurations, including the creation of named profiles to manage multiple sets of credentials. Additionally, environment variables, such as “AWS_ACCESS_KEY_ID” and “AWS_SECRET_ACCESS_KEY,” can be set to configure credentials on a per-session basis. These diverse approaches cater to users’ preferences and needs, offering a range of options to customize AWS CLI settings efficiently.
AWS Profile using AccessKey and Secret
Avoid this method if possible.
AWS Profile using SSO IAM Role
SSO based IAM profiles require directory/sso configuration. Read more about SSO set up here.
AWS Profile using EC2 meta data
EC2 metadata service, requires EC2 instance IAM role to have assume role permissions.
Related
-
Download AWS CLI - https://aws.amazon.com/cli/ ↩