Challenge - 5 Problems
CLI Scripting Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
What is the output of this AWS CLI command?
You run the following AWS CLI command to list all S3 buckets in your account:
What will be the output format?
aws s3api list-buckets --query 'Buckets[].Name' --output textWhat will be the output format?
Attempts:
2 left
💡 Hint
Think about what the --output text option does in AWS CLI.
✗ Incorrect
The --output text option formats the output as plain text, and the query selects only the bucket names, so the result is a tab-separated list of bucket names.
❓ Configuration
intermediate2:00remaining
Which AWS CLI command sets the default region for future commands?
You want to configure your AWS CLI so that all future commands use the region us-west-2 by default. Which command achieves this?
Attempts:
2 left
💡 Hint
The AWS CLI uses the configure set command to change settings.
✗ Incorrect
The correct syntax to set the default region is 'aws configure set region us-west-2'.
❓ security
advanced2:00remaining
What error occurs when running this AWS CLI command without permissions?
You run this command to list EC2 instances:
Your IAM user does not have permission to describe instances. What error message will you see?
aws ec2 describe-instancesYour IAM user does not have permission to describe instances. What error message will you see?
Attempts:
2 left
💡 Hint
Think about what happens when you lack permissions to perform an AWS action.
✗ Incorrect
AWS returns an AccessDeniedException error when the user lacks permissions for the requested action.
❓ Architecture
advanced3:00remaining
Which AWS CLI command sequence correctly creates and tags an EC2 instance?
You want to create an EC2 instance and then add a Name tag to it using AWS CLI. Which sequence of commands is correct?
Attempts:
2 left
💡 Hint
Creating tags requires the instance ID, which you get after launching the instance.
✗ Incorrect
You first launch the instance, then use its ID to create tags. The run-instances command does not accept a --tag or --tags parameter directly.
✅ Best Practice
expert3:00remaining
What is the best practice to securely run AWS CLI commands in automated scripts?
You want to run AWS CLI commands in an automated script on a server. Which approach is best to securely provide credentials?
Attempts:
2 left
💡 Hint
Think about avoiding hardcoding secrets and using AWS features for security.
✗ Incorrect
Using IAM roles attached to the server or instance provides temporary credentials automatically and avoids exposing secrets in code or files.