Session | AWS CLI Exercises
AWS CLI Exercises
In this section, you'll use the Ruby AWS SDK to interact with the S3 service.
By default, AWS will use the configuration that is located in ~/.aws/configuration. This file contains the Access Key ID and Secret Access Key that you set when you typed $ aws configure.
IAM from the CLI
Installing and configuring the AWS CLI tool gives you command line access to the AWS service suite. Although we won't dive deeply into the CLI tool functionality, let's try a few commands:
Try It: IAM from the CLI
Type the following commands:
aws iam list-usersaws iam list-groupsaws iam get-user
Can you use the IAM tag-role documentation to give your user a tag? You can use any key and value that you want, or you can use the key (department) and value (accounting) from the docs example.
The reason that these commands work for us is that our CLI is configured with a user that has admin access. If we were to reconfigure with a user that has fewer permissions,
Try It: S3 from the CLI
Type the following commands:
aws s3 ls- Make a new bucket:
aws s3 mb s3://<YOURBUCKETNAMEHERE>
Can you use the S3 cp documentation to copy a file on your computer to a specific bucket in your account?