

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Identity and Access Management (IAM)
incomplete
2: IAM Users
incomplete
3: Inline Policies
incomplete
4: IAM Groups
incomplete
5: IAM Roles
incomplete
6: Deny Policies
incomplete
7: SSM Parameters
incomplete
8: SSM Parameters Are Strings
incomplete
9: Accessing SSM Parameters from EC2
incomplete
10: Use SSM from EC2
incomplete
11: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Policies allow or deny actions on specific resources. They look something like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow", // <--- 1. Are we allowing or denying?
"Action": [
"ec2:Describe*" // <--- 2. Which API actions are affected?
],
"Resource": "*" // <--- 3. Which targets are affected?
}
]
}
A policy has three main parts:
Allow or Deny. Are we permitting or denying these actions?DescribeInstances, CreateBucket, or PutObject.Vincent Vega needs to see EC2 instances for a dashboard he's building, but make sure he can't break anything.
Add an inline read-only policy patientping-ec2-readonly (EC2 Describe only) to patientping-admin-vinny.
Cost check: Creating IAM policies is free; costs arise from service usage.
Let's add this policy the wrong way (inline) first, and we'll fix it in the next lesson.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["ec2:Describe*"],
"Resource": "*"
}
]
}
Run and submit the CLI tests.
Here's how to create an inline policy with the AWS CLI (assuming you've prepared a JSON file for the policy):
aws iam put-user-policy --user-name patientping-admin-vinny --policy-name patientping-ec2-readonly --policy-document file://POLICY-FILE.json