The AWS CLI supports named profiles stored in the config and credentials files. You can configure additional profiles by using aws configure with the --profile option or by adding entries to the config and credentials files.1
- Configuration and Credential File Settings - You can save your frequently used configuration settings and credentials in files that are maintained by the AWS CLI.
AWS Identity and Access Management (IAM) enables you to securely control access to AWS services and resources for your users. Using IAM, you can create and manage AWS users and groups and use permissions to allow and deny their access to AWS resources.2
Provide the user with the proper permissions required to complete command line task(s) as needed, see Controlling Access Using Policies
When creating profiles having both the AWS Access Key ID and AWS Secret Access Key are required.
$ aws configure --profile myprofile1 $ aws configure --profile myprofile2
$ aws --profile myprofile1 --region us-east-1 ec2 describe-volume
Filter Name is always lower case, see Supported Filters ec2-describe-instances
$ aws --profile myprofile1 --region us-west-1 ec2 describe-instances --filters "Name=instance-type,Values=m1.small,m1.medium"
$ aws --profile myprofile1 --region us-west-1 ec2 describe-instances --query "Reservations[*].Instances[*].[Placement.AvailabilityZone, State.Name, InstanceId]"
$ aws --profile myprofile1 --region us-west-1 ec2 create-image --instance-id i-123456 --name "MyAMIName" --description "Some Description"