0
0
AWScloud~10 mins

Using profiles for multiple accounts in AWS - Interactive Code Practice

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

Complete the command to list S3 buckets using a specific AWS profile.

AWS
aws s3 ls --profile [1]
Drag options to blanks, or click blank then click option'
Adefault
Bprod-account
Cdev-account
Dtest-account
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'default' when you want a specific account
Omitting the --profile option
Using a profile name that does not exist
2fill in blank
medium

Complete the AWS CLI command to configure a new profile named 'prod-account'.

AWS
aws configure --profile [1]
Drag options to blanks, or click blank then click option'
Adev-account
Bprod-account
Cdefault
Dtest-account
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'default' instead of the intended profile name
Misspelling the profile name
Omitting the --profile option
3fill in blank
hard

Fix the error in the command to assume a role using a profile.

AWS
aws sts assume-role --role-arn [1] --role-session-name MySession --profile dev-account
Drag options to blanks, or click blank then click option'
Aarn:aws:iam::123456789012:role/DevRole
Barn:aws:s3:::mybucket
Carn:aws:iam::123456789012:user/DevUser
Darn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a user ARN instead of a role ARN
Using a resource ARN like S3 bucket or EC2 instance
Misspelling the ARN
4fill in blank
hard

Fill both blanks to set environment variables for AWS CLI to use the 'test-account' profile.

AWS
export AWS_PROFILE=[1]
aws s3 ls --profile [2]
Drag options to blanks, or click blank then click option'
Atest-account
Bprod-account
Cdev-account
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using different profiles in environment variable and command
Using 'default' instead of the intended profile
Omitting the export command
5fill in blank
hard

Fill all three blanks to create a named profile with access key and region.

AWS
[[1]]
aws_access_key_id=[2]
region=[3]
Drag options to blanks, or click blank then click option'
Aprod-account
BAKIAIOSFODNN7EXAMPLE
Cus-west-2
Ddev-account
Attempts:
3 left
💡 Hint
Common Mistakes
Using profile name without brackets
Swapping access key and region values
Using incorrect region format