

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
While inline policies are attached directly to a single user, the preferred way to manage permissions in AWS is to create groups and give them the policies (sometimes called customer-managed policies).
This DRYs up your permissions management and makes it much easier to ensure that everyone has only the access levels they need.
Let's convert our inline policy into a customer-managed policy, then attach it to a group.
PatientPing's CISO has "thoughts" about our inline policies. Per last week's security review: no more inline policies on users.
Create a customer-managed policy patientping-ec2-readonly and a group patientping-ec2-readers. Attach the policy to the group, add patientping-admin-vinny to the group, and remove the inline policy from the user.
Cost check: Creating IAM groups and policies is free; costs arise from service usage.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["ec2:Describe*"],
"Resource": "*"
}
]
}
Run and submit the CLI tests.
For CLI users, here's how to create IAM groups, policies, and manage group membership:
# Create a customer-managed policy
aws iam create-policy --policy-name POLICY-NAME --policy-document file://POLICY-FILE.json
# Create a group
aws iam create-group --group-name GROUP-NAME
# Attach policy to group
aws iam attach-group-policy --group-name GROUP-NAME --policy-arn POLICY-ARN
# Add user to group
aws iam add-user-to-group --group-name GROUP-NAME --user-name USER-NAME
# Remove the inline policy from the user
aws iam delete-user-policy --user-name USER-NAME --policy-name POLICY-NAME