IAM: Users & Groups

So, IAM stands for Identity and Access Management. It is a global service because in IAM we create users and put them into groups.

img2

IAM: Permissions

Example JSON policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ec2:Describe*",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "elasticloadbalancing:Describe*",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:ListMetrics",
        "cloudwatch:GetMetricStatistics",
        "cloudwatch:Describe*"
      ],
      "Resource": "*"
    }
  ]
}

In short: This policy gives read-only access to EC2, Load Balancer, and CloudWatch services.

Create Users in AWS

Let’s practice creating users in AWS using the IAM service.

  1. In the AWS search bar, type IAM and open the IAM console.
  2. On the IAM Dashboard, you may see some security recommendations. We don’t need to worry about them for now.
  3. On the left side, click Users. This is where we can create new IAM users.

img3

Important note:

Why do we create users?

Now, let’s go ahead and create a user. On the Users page, click the “Create user” button.

img4

After entering the username, click Next. Now we need to add permissions to the user. You can add permissions directly to the user, or You can use a group to give permissions.

Let’s create a group:

Click the Create group button

img5

img6

Click Create user group. Now that the group is ready, we can add the user to the admin group.

img7

Click Next to go to the Review page.

Here you can check everything before creating the user:

img8

Click Create user. Now the user is created successfully.

img9

After creating the user, you can:

Let’s go back to the user list and check everything. Here we can see user list.

img10

On the left side, if we click User groups, we can see the group called admins. The admins group has one user in it, named HakobAdmin.

img11

If we look at the permissions of the admins group, we can see that the AdministratorAccess policy is attached to it.

img12

If we open the user HakobAdmin, we can also see the AdministratorAccess policy. However, this permission was not added directly to the user. The user received this permission through the admin group.

img13

This means that HakobAdmin inherited all the permissions of the group. This is why we put users in groups—it makes permission management simpler.

Now let’s go back to the IAM Dashboard because we want to sign in with our new user, HakobAdmin. First, we can look at our AWS account information. The account has an account ID and a sign-in URL. We can also customize the sign-in URL by creating an account alias.

img14

You can Edit or Create alias.

img15

Now you can use https://htp1.signin.aws.amazon.com/console to log in.