课程: AWS for Developers: DynamoDB
Installing the AWS CLI - Amazon Web Services (AWS)教程
课程: AWS for Developers: DynamoDB
Installing the AWS CLI
- [Instructor] If you haven't done so already, let's install the AWS command line interface to work with our DynamoDB. If you go to docs.aws.amazon.com /cli/latest/userguide/cli-chap-install.html you'll see the options for installing the AWS CLI for your operating system. Since I'm working on Mac OS, I'm going to go ahead and select that option right here and you can see that I can install the AWS CLI using the bundled installer, and this is as simple as just taking this command and typing it into my prompt. So I'm going to grab this here. And paste that. And then I will go ahead and unzip it. And I will go ahead and run this third command to actually run the installer. If your install worked correctly you can type aws --version and you'll get a version number. I'm using 1.16.157. Let's go ahead some information about that table we created. We use aws dynamodb describe -table - -table-name and our table you remember is called BaseballStats. Well this is going to complain because it has no idea how to connect to our table, so we're going to need to run AWS configure. And the first thing it's going to say is give me an AWS access key ID. So for that I have to go back to the IAM management console which I've opened here. And I need to select users, and I need to add a new user. Let's go ahead and add my user iamsap and we will grant programmatic as well as console access. Click Continue. Now I'm going to attach a policy, and there is a DynamoDB policy in here that I want called Full Access, there it is the first one in the list. I'll select Next, Next Review, go ahead and Create that user. Here's my info, I have my access key and my secret access key. Let's copy the access key first, return. Then we'll take the secret access key, copy that. Paste, and we're going to select our default region which is us-east-2, we'll stick with that for now. Now let's go ahead and talk to our table again, I'll keep pushing up until I find my previous command, run it again, and I see stats on my table. I see the provision throughput as well as information on the key schema, I'm using a hash for team ID and a range for the sort key. You could even see how many items are in my table.
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。