To configure the AWS Command Line Interface (CLI), you can follow these steps:
1. Install the AWS CLI
If you haven’t already installed the AWS CLI, you can download and install it from the AWS CLI installation page.
2. Configure the AWS CLI
Once installed, you need to configure it with your AWS credentials and settings. Open your terminal or command prompt and run the following command:
aws configure
You will be prompted to enter the following information:
- AWS Access Key ID: Your AWS access key ID.
- AWS Secret Access Key: Your AWS secret access key.
- Default region name: The default region you want to use (e.g.,
us-west-2
). - Default output format: The format in which you want the CLI to return results (e.g.,
json
,text
,table
).
Example Configuration
$ aws configure
AWS Access Key ID [None]: your-access-key-id
AWS Secret Access Key [None]: your-secret-access-key
Default region name [None]: us-west-2
Default output format [None]: json
3. Verify Configuration
You can verify your configuration by listing your S3 buckets:
aws s3 ls
4. Using Profiles
If you need to manage multiple AWS accounts, you can create named profiles. To create a profile, use the --profile
option:
aws configure --profile profile-name
To use a specific profile, include the --profile
option in your commands:
aws s3 ls --profile profile-name
Configuration Files
The configuration settings are stored in two files:
- config: Located at
~/.aws/config
on Linux or macOS, orC:\Users\USERNAME\.aws\config
on Windows. - credentials: Located at
~/.aws/credentials
on Linux or macOS, orC:\Users\USERNAME\.aws\credentials
on Windows12.
Would you like more detailed information on any specific step?
1: AWS CLI User Guide 2: AWS CLI Configuration
标签:profile,Configure,1044,AWS,aws,configure,your,CLI From: https://www.cnblogs.com/alex-bn-lee/p/18373742