0
0
AWScloud~10 mins

CLI scripting basics in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to list all S3 buckets using AWS CLI.

AWS
aws s3 [1]
Drag options to blanks, or click blank then click option'
Acreate-bucket
Bdelete-bucket
Cls
Dput-object
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create-bucket' instead of 'ls' will try to create a bucket.
Using 'delete-bucket' will attempt to remove a bucket, not list them.
2fill in blank
medium

Complete the code to create a new S3 bucket named 'my-bucket' in the us-west-2 region.

AWS
aws s3api create-bucket --bucket my-bucket --region us-west-2 --[1] LocationConstraint=us-west-2
Drag options to blanks, or click blank then click option'
Ainput
Bcreate-bucket-configuration
Coutput
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--output' or '--input' does not set the bucket region.
Using '--create' is not a valid AWS CLI option.
3fill in blank
hard

Fix the error in the command to copy a file named 'photo.jpg' to the S3 bucket 'my-bucket'.

AWS
aws s3 cp [1] s3://my-bucket/
Drag options to blanks, or click blank then click option'
Aphotojpeg
Bphoto
Cphoto.png
Dphoto.jpg
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the file extension causes the command to fail.
Using a wrong file extension like '.png' or misspelled name.
4fill in blank
hard

Fill both blanks to list all EC2 instances in the 'us-west-2' region with detailed information.

AWS
aws ec2 [1] --region [2] --output json
Drag options to blanks, or click blank then click option'
Adescribe-instances
Bus-east-1
Cus-west-2
Dlist-instances
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list-instances' is not a valid AWS CLI command.
Setting the wrong region will show no instances or error.
5fill in blank
hard

Fill all three blanks to create a new IAM user named 'developer' with programmatic access and attach the 'AmazonS3ReadOnlyAccess' policy.

AWS
aws iam create-user --user-name [1] && aws iam create-access-key --user-name [2] && aws iam attach-user-policy --user-name [3] --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
Drag options to blanks, or click blank then click option'
Aadmin
Bdeveloper
Cuser
Dreadonly
Attempts:
3 left
💡 Hint
Common Mistakes
Using different user names in each command causes errors.
Using generic names like 'admin' or 'user' instead of 'developer'.