0
0
AWScloud~20 mins

Using profiles for multiple accounts in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
AWS Profiles Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding AWS CLI Profiles

You have configured two AWS CLI profiles named dev and prod for different AWS accounts. Which command correctly lists the S3 buckets in the prod account?

Aaws s3 ls --profile dev
Baws s3 ls --account prod
Caws s3 ls --profile prod
Daws s3 ls
Attempts:
2 left
💡 Hint

Use the --profile option to specify which account profile to use.

Configuration
intermediate
2:00remaining
Configuring Multiple AWS Profiles

You want to add a new AWS CLI profile named test with access key AKIA123TEST and secret key secretTestKey. Which command correctly sets this profile?

Aaws configure set profile test aws_access_key_id AKIA123TEST aws_secret_access_key secretTestKey
Baws configure set aws_access_key_id AKIA123TEST --profile test && aws configure set aws_secret_access_key secretTestKey --profile test
Caws configure create test AKIA123TEST secretTestKey
Daws configure add-profile test --access-key AKIA123TEST --secret-key secretTestKey
Attempts:
2 left
💡 Hint

Use aws configure set with the --profile option to set keys for a named profile.

Architecture
advanced
2:00remaining
Best Practice for Managing Multiple AWS Accounts

You manage multiple AWS accounts for development, testing, and production. Which approach best isolates credentials and reduces risk?

AUse separate AWS CLI profiles for each account with unique credentials stored locally.
BUse the same AWS CLI profile with shared credentials for all accounts.
CUse environment variables to switch credentials manually without profiles.
DUse a single root account access key for all environments.
Attempts:
2 left
💡 Hint

Consider isolation and security best practices when managing multiple accounts.

service_behavior
advanced
2:00remaining
Effect of Profile on AWS SDK Behavior

You run a Python script using boto3 without specifying a profile. Your AWS CLI has two profiles: default and staging. Which profile will boto3 use by default?

AWS
import boto3
s3 = boto3.client('s3')
buckets = s3.list_buckets()
print([b['Name'] for b in buckets['Buckets']])
AThe <strong>default</strong> profile configured in AWS CLI.
BNo profile; the script will fail with a credentials error.
CThe <strong>staging</strong> profile because it is the last created.
DThe profile specified in the AWS_PROFILE environment variable, if set; otherwise <strong>default</strong>.
Attempts:
2 left
💡 Hint

Check how boto3 selects credentials when no profile is explicitly given.

security
expert
2:00remaining
Security Risk of Storing AWS Credentials in Plain Text

You have multiple AWS CLI profiles stored in ~/.aws/credentials file in plain text. What is the main security risk of this setup?

AIf the file permissions are too open, unauthorized users or processes can read the credentials and access your AWS accounts.
BAWS automatically encrypts the credentials file, so there is no risk.
CStoring credentials in plain text causes AWS to reject API calls for security reasons.
DThe credentials file can only be accessed by root user, so there is no risk.
Attempts:
2 left
💡 Hint

Consider file permissions and who can read the credentials file.