Getting started with Identity and Access Management

Create a group with read-only compute access, put a new IAM user in it, check what the user may do, and clean up.

Last updated 18 November 2026View as Markdown

In about ten minutes you give a group the managed policy Ec2ReadOnlyAccess, add an IAM user called alice to it, and confirm with the policy simulator that she may list instances but not terminate them. Nothing here is charged. Replace org-EXAMPLE1234 with your organization id, and the ids the CLI prints where the commands ask for them.

Prerequisites

  • You are the organization owner, or your policies allow iam:CreateGroup, iam:AttachGroupPolicy, iam:CreateUser, iam:AddUserToGroup, iam:SimulatePrincipalPolicy, iam:DeleteUser and iam:DeleteGroup.
  • For the console, also iam:ListGroups, iam:GetGroup, iam:ListUsers and iam:GetUser to open the lists and the pages (a group's or user's page answers 404 without the Get action).
  • For the CLI, also iam:ListPolicies to find the policy's id.
  • For the CLI: dcloud auth login has signed you in; see Sign in the CLI.

Step 1: Create a group

  1. Open Identity, then choose Groups.
  2. Choose Create group, enter developers as the group name, and choose Create group. The group's page opens.

Step 2: Attach a managed policy to the group

  1. On the group's page, choose Permissions.
  2. Open the policy list, choose Ec2ReadOnlyAccess, then choose Attach.

Step 3: Create an IAM user and add it to the group

  1. Choose Users, then Create user.
  2. For Username, enter alice. Leave Type at User.
  3. Choose Create user. The user's page opens.
  4. Go back to the group developers and choose Members.
  5. Open the user list, choose alice, then choose Add.

Step 4: Check what the user may do

  1. Choose Policy simulator.
  2. For Who, choose alice. For Action, search for and choose ec2:DescribeInstances. For Resource, enter rn:ews:de1:org-EXAMPLE1234:ec2:*.
  3. Choose Simulate. The answer is Allowed, through the group developers.
  4. Choose ec2:TerminateInstances for Action and choose Simulate again. The answer is Implicitly denied: no statement allows it.

Clean up

Deleting the user removes its group membership; deleting the group detaches its policy. The managed policy itself stays.

  1. Open the user alice, choose Danger zone, then Delete IAM user. Type the user name and confirm.
  2. Open the group developers, choose Danger zone, then Delete group. Type the group name and confirm.

Next steps

Did this page help you?