Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is an IAM policy in AWS?
An IAM policy is a JSON document that defines permissions for AWS resources. It tells who can do what on which resource.
Click to reveal answer
beginner
What are the main parts of an IAM policy JSON?
The main parts are: 1. Version - policy language version 2. Statement - list of permission rules 3. Effect - Allow or Deny 4. Action - what actions are allowed or denied 5. Resource - which AWS resources the policy applies to
Click to reveal answer
beginner
What does the 'Effect' field in an IAM policy specify?
The 'Effect' field specifies whether the policy allows or denies the actions. It can be either 'Allow' or 'Deny'.
Click to reveal answer
beginner
How do you specify multiple actions in an IAM policy?
You list multiple actions as an array of strings under the 'Action' field, for example: ["s3:GetObject", "s3:PutObject"].
Click to reveal answer
beginner
What is the purpose of the 'Resource' field in an IAM policy?
The 'Resource' field specifies which AWS resources the policy applies to, using ARNs (Amazon Resource Names).
Click to reveal answer
Which field in an IAM policy JSON defines whether to allow or deny permissions?
AEffect
BAction
CResource
DVersion
✗ Incorrect
The 'Effect' field specifies if the policy allows or denies the actions.
What type of document format is used for IAM policies?
AYAML
BJSON
CXML
DCSV
✗ Incorrect
IAM policies are written in JSON format.
In an IAM policy, where do you list the AWS actions you want to allow or deny?
AEffect
BResource
CAction
DStatement
✗ Incorrect
The 'Action' field lists the AWS actions the policy controls.
What does the 'Version' field in an IAM policy specify?
AThe AWS service version
BThe resource version
CThe user version
DThe policy language version
✗ Incorrect
The 'Version' field specifies the version of the policy language.
Which of the following is a valid 'Effect' value in an IAM policy?
AAllow
BAuthorize
CGrant
DPermit
✗ Incorrect
'Allow' is the correct value to permit actions in IAM policies.
Describe the structure of an AWS IAM policy JSON document.
Think about the main parts that define permissions.
You got /5 concepts.
Explain how you would allow a user to read objects from a specific S3 bucket using an IAM policy.
Focus on the Effect, Action, and Resource fields.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of an IAM policy in AWS?
easy
A. To create virtual machines
B. To define permissions for users and resources
C. To monitor network traffic
D. To store data in the cloud
Solution
Step 1: Understand IAM policy role
An IAM policy is a JSON document that specifies permissions for AWS users, groups, or roles.
Step 2: Identify main function
Its main function is to control what actions are allowed or denied on AWS resources.
Final Answer:
To define permissions for users and resources -> Option B
Quick Check:
IAM policy = permissions definition [OK]
Hint: IAM policies control access permissions in AWS [OK]
Common Mistakes:
Confusing IAM policies with data storage
Thinking IAM policies monitor network traffic
Assuming IAM policies create virtual machines
2. Which of the following is the correct JSON key to specify the effect of a statement in an IAM policy?
easy
A. "Permission"
B. "Action"
C. "Resource"
D. "Effect"
Solution
Step 1: Recall IAM policy statement keys
IAM policy statements include keys like Effect, Action, Resource, and optionally Condition.
Step 2: Identify key for permission type
The key that specifies whether to allow or deny is "Effect".
Final Answer:
"Effect" -> Option D
Quick Check:
Effect key = permission type [OK]
Hint: Effect key sets allow or deny in IAM policy [OK]
B. The Condition key should be inside the Action key
C. The policy is valid and has no errors
D. The Resource value "*" is not allowed for these actions
Solution
Step 1: Check Condition usage with EC2 actions
EC2 supports conditions like StringEquals on ec2:Region to restrict actions by region.
Step 2: Verify Resource and structure
Resource "*" is valid for EC2 start/stop actions because they apply to instances across resources.
Final Answer:
The policy is valid and has no errors -> Option C
Quick Check:
Condition on ec2:Region with Resource "*" is valid [OK]
Hint: Conditions can restrict actions by region or other keys [OK]
Common Mistakes:
Thinking Condition is invalid for EC2
Assuming Resource "*" is always wrong
Misplacing Condition inside Action
5. You want to create an IAM policy that allows a user to read objects only from a specific S3 bucket named "my-data-bucket" but denies deleting any objects. Which policy statement correctly achieves this?
hard
A. {
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::my-data-bucket/*"
}
B. {
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:DeleteObject"],
"Resource": "arn:aws:s3:::my-data-bucket/*"
}
C. {
"Effect": "Deny",
"Action": "s3:DeleteObject",
"Resource": "arn:aws:s3:::my-data-bucket/*"
}
D. {
"Effect": "Allow",
"Action": "s3:*",
"Resource": "arn:aws:s3:::my-data-bucket"
}
Solution
Step 1: Identify required permissions
The user needs permission to read objects only, which is "s3:GetObject" on the bucket's objects.
Step 2: Check for delete denial
Not including "s3:DeleteObject" means no delete permission is granted. Explicit deny is not required if no allow exists.
Step 3: Validate resource ARN
The resource must include "/*" to specify objects inside the bucket, not the bucket itself.
Final Answer:
Allow s3:GetObject on objects in my-data-bucket only -> Option A