brew install awscli
Verify the installation
For general use, the
aws configure command is the fastest way to set up your AWS CLI installation. When you enter this command, the AWS CLI prompts you for four pieces of information:
Make sure you have all of the above information before you start the next steps!
aws configure then input your information like this:
A collection of settings is called a profile. By default, the AWS CLI uses the
default profile. You can create and use additional named profiles with varying credentials and settings by specifying the
--profile option and assigning a name.
The following example creates a profile named
aws configure --profile Zacks
You can then specify a
--profile profilename and use the credentials and settings stored under that name.
aws s3 ls --profile Zacks
To update these settings, run
aws configure again (with or without the
--profile parameter, depending on which profile you want to update) and enter new values as appropriate. The next sections contain more information about the files that
aws configure creates, additional settings, and named profiles.
For more information on named profiles, see Named profiles.
Choose your account name in the navigation bar, and then choose My Security Credentials.
If you see a warning about accessing the security credentials for your AWS account, choose Continue to Security Credentials.
Expand the Access keys (access key ID and secret access key) section.
Create New Access Key. If this feature is disabled, then you must delete one of the existing access keys before you can create a new key. For more information, see IAM Entity Object Limits in the IAM User Guide.
A warning explains that you have only this one opportunity to view or download the secret access key. It cannot be retrieved later.
- If you choose Show Access Key, you can copy the access key ID and secret key from your browser window and paste it somewhere else.
- If you choose Download Key File, you receive a file named rootkey.csv that contains the access key ID and the secret key. Save the file somewhere safe.
When you no longer use the access key we recommend that you delete it, or at least mark it inactive by choosing Make Inactive so that it cannot be misused.
You can set any credentials or configuration settings using aws configure set. Specify the profile that you want to view or modify with the
For example, the following command sets the
region in the profile named
aws configure set region us-east-1 --profile username
To remove a setting, use an empty string as the value, or manually delete the setting in your
credentials files in a text editor.
aws configure set cli_pager "" --profile username
You can retrieve any credentials or configuration settings you’ve set using
aws configure get. Specify the profile that you want to view or modify with the
For example, the following command retrieves the region setting in the profile named
aws configure get region --profile username
List the profiles available to the AWS CLI.
aws configure list-profiles
List the AWS CLI configuration data. This command will show you the current configuration data. For each configuration item, it will show you the value, where the configuration value was retrieved, and the configuration variable name. For example, if you provide the AWS region in an environment variable, this command will show you the name of the region you’ve configured, it will tell you that this value came from an environment variable, and it will tell you the name of the environment variable.
aws configure list
Set a configuration value from the config file.
aws configure set command can be used to set a single configuration value in the AWS config file.
aws configure set [varname] [value] [--profile profile-name]
Set region for a specific profile.
List S3 objects and common prefixes under a prefix or all S3 buckets. Note that the –output and –no-paginate arguments are ignored for this command.
List all of my S3 buckets under