Complete the code to identify the AWS user type with full account access.
if user == '[1]': print("Full account access granted.")
The root user has full access to all AWS services and resources in the account.
Complete the code to create an AWS user with limited permissions.
new_user = create_user('[1]')
IAM users are created to have specific permissions and do not have full account access.
Fix the error in the code that checks if a user is the root user.
if user == '[1]': print("Access granted")
The string to check for the root user must be exactly 'root user' to correctly identify it.
Fill both blanks to define a policy that allows only IAM users to access a resource.
policy = {
'Effect': 'Allow',
'Principal': {'AWS': '[1]'},
'Action': '[2]'
}The Principal ARN with 'user/*' specifies IAM users. The Action 's3:*' allows all S3 actions.
Fill all three blanks to create a policy that denies root user access but allows IAM users to list S3 buckets.
policy = {
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Deny',
'Principal': {'AWS': '[1]'},
'Action': 's3:*',
'Resource': '*'
},
{
'Effect': 'Allow',
'Principal': {'AWS': '[2]'},
'Action': '[3]',
'Resource': '*'
}
]
}The root user ARN is denied all S3 actions. IAM users are allowed to list all buckets with 's3:ListAllMyBuckets'.