Complete the code to create an IAM user named 'Alice'.
aws iam create-user --user-name [1]The command creates an IAM user named 'Alice'. This is the correct user name for this example.
Complete the code to attach the 'ReadOnlyAccess' policy to the IAM user.
aws iam attach-user-policy --user-name Alice --policy-arn [1]The 'ReadOnlyAccess' policy ARN is used to give read-only permissions to the user.
Fix the error in the command to list all IAM users.
aws iam [1]-usersThe correct AWS CLI command to list IAM users is 'aws iam list-users'.
Fill both blanks to create a policy document that allows listing S3 buckets.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "[1]",
"Resource": "[2]"
}]
}The action 's3:ListAllMyBuckets' allows listing all buckets, and the resource 'arn:aws:s3:::*' applies to all buckets.
Fill all three blanks to create an IAM role trust policy allowing EC2 to assume the role.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"Service": "[1]"},
"Action": "[2]",
"Condition": {"ArnLike": {"[3]": "arn:aws:ec2:*:*:instance/*"}}
}]
}The service principal is 'ec2.amazonaws.com', the action is 'sts:AssumeRole', and the condition key is 'aws:SourceArn' to specify the source.