- Effective DevOps with AWS
- Nathaniel Felsen
- 184字
- 2025-04-04 18:42:30
Configuring the AWS CLI
To do this, you will need to extract the Access Key and Secret Access Key from the file downloaded in Step 4 of the section creating a new user in IAM:
$ more credentials.csv User Name,Access Key Id,Secret Access Key "Nat",AKIACZ6HA,f6hoyLgExmoq/V4VQjf3nB
We will run the following command to configure our AWS account, as follows:
$ aws configure AWS Access Key ID [None]: AKIACZ6HA AWS Secret Access Key [None]: f6hoyLgExmoq/V4VQjf3nB Default region name [None]: us-east-1 Default output format [None]:
At this point, we are ready to start using the CLI. We can quickly verify that everything is working by listing the user accounts, as follows:
$ aws iam list-users { "Users": [ { "UserName": "Nat", "PasswordLastUsed": "2017-07-30T03:11:30Z", "CreateDate": "2017-07-28T09:23:50Z", "UserId": "AKIACZ6HA", "Path": "/", "Arn": "arn:aws:iam::511912822959:user/Nat" } ]
}
AWS aws-shell
Amazon has a second CLI tool called aws-shell. The tool is more interactive than the classic awscli command. It offers out-of-the-box auto-completion and a split-screen view that lets you access the documentation as you type your commands. If you are a new AWS user, give it a shot (pip install aws-shell).
Amazon has a second CLI tool called aws-shell. The tool is more interactive than the classic awscli command. It offers out-of-the-box auto-completion and a split-screen view that lets you access the documentation as you type your commands. If you are a new AWS user, give it a shot (pip install aws-shell).