0
0
AWScloud~30 mins

IAM policies (JSON structure) in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Create a Basic AWS IAM Policy JSON
📖 Scenario: You are setting up permissions for a new AWS user who needs to read objects from a specific S3 bucket.
🎯 Goal: Build a valid AWS IAM policy in JSON format that allows read-only access to the example-bucket S3 bucket.
📋 What You'll Learn
Create a JSON policy with the correct version
Specify the S3 service in the policy
Allow the action s3:GetObject
Restrict access to the bucket named example-bucket
Use the correct resource ARN format for the bucket objects
💡 Why This Matters
🌍 Real World
IAM policies control who can do what in AWS. Creating correct policies is essential for security and access management.
💼 Career
Cloud engineers and administrators regularly write and manage IAM policies to secure AWS resources.
Progress0 / 4 steps
1
Create the basic IAM policy structure
Create a variable called policy and assign it a dictionary with the key Version set to the string "2012-10-17".
AWS
Need a hint?

The Version key is required in every IAM policy and usually set to "2012-10-17".

2
Add the Statement list with one statement
Add a key Statement to the policy dictionary. Set it to a list containing one dictionary with the key Effect set to "Allow".
AWS
Need a hint?

The Statement key holds a list of permission statements. Each statement needs an Effect key.

3
Specify the Action and Resource in the statement
Inside the statement dictionary in policy["Statement"], add the key Action with the value "s3:GetObject" and the key Resource with the value "arn:aws:s3:::example-bucket/*".
AWS
Need a hint?

The Action specifies what is allowed. The Resource specifies which bucket objects are accessible.

4
Complete the IAM policy JSON structure
Ensure the policy dictionary is a complete valid IAM policy JSON with Version, Statement list containing one statement with Effect, Action, and Resource keys as specified.
AWS
Need a hint?

Review the entire policy dictionary to confirm it matches the required structure.