Identity and access management for Amazon EC2 - Amazon Elastic Compute Cloud

Identity and access management for Amazon EC2

Your security credentials identify you to services in AWS and grant you unlimited use of your AWS resources, such as your Amazon EC2 resources. You can use features of Amazon EC2 and AWS Identity and Access Management (IAM) to allow other users, services, and applications to use your Amazon EC2 resources without sharing your security credentials. You can use IAM to control how other users use resources in your AWS account, and you can use security groups to control access to your Amazon EC2 instances. You can choose to allow full use or limited use of your Amazon EC2 resources.

Network access to your instance

A security group acts as a firewall that controls the traffic allowed to reach one or more instances. When you launch an instance, you assign it one or more security groups. You add rules to each security group that control traffic for the instance. You can modify the rules for a security group at any time; the new rules are automatically applied to all instances to which the security group is assigned.

For more information, see Authorize inbound traffic for your Windows instances.

Amazon EC2 permission attributes

Your organization might have multiple AWS accounts. Amazon EC2 enables you to specify additional AWS accounts that can use your Amazon Machine Images (AMIs) and Amazon EBS snapshots. These permissions work at the AWS account level only; you can't restrict permissions for specific users within the specified AWS account. All users in the AWS account that you've specified can use the AMI or snapshot.

Each AMI has a LaunchPermission attribute that controls which AWS accounts can access the AMI. For more information, see Make an AMI public.

Each Amazon EBS snapshot has a createVolumePermission attribute that controls which AWS accounts can use the snapshot. For more information, see Share an Amazon EBS snapshot.

IAM and Amazon EC2

IAM enables you to do the following:

  • Create users and groups under your AWS account

  • Assign unique security credentials to each user under your AWS account

  • Control each user's permissions to perform tasks using AWS resources

  • Allow the users in another AWS account to share your AWS resources

  • Create roles for your AWS account and define the users or services that can assume them

  • Use existing identities for your enterprise to grant permissions to perform tasks using AWS resources

By using IAM with Amazon EC2, you can control whether users in your organization can perform a task using specific Amazon EC2 API actions and whether they can use specific AWS resources.

This topic helps you answer the following questions:

  • How do I create groups and users in IAM?

  • How do I create a policy?

  • What IAM policies do I need to carry out tasks in Amazon EC2?

  • How do I grant permissions to perform actions in Amazon EC2?

  • How do I grant permissions to perform actions on specific resources in Amazon EC2?

Create an IAM group and users

To create an IAM group

  1. Open the IAM console at

  2. In the navigation pane, choose Groups and then choose Create New Group.

  3. For Group Name, enter a name for your group, and then choose Next Step.

  4. On the Attach Policy page, select an AWS managed policy and then choose Next Step. For example, for Amazon EC2, one of the following AWS managed policies might meet your needs:

    • PowerUserAccess

    • ReadOnlyAccess

    • AmazonEC2FullAccess

    • AmazonEC2ReadOnlyAccess

  5. Choose Create Group.

Your new group is listed under Group Name.

To create an IAM user, add the user to your group, and create a password for the user

  1. In the navigation pane, choose Users, Add user.

  2. For User name, enter a user name.

  3. For Access type, select both Programmatic access and AWS Management Console access.

  4. For Console password, choose one of the following:

    • Autogenerated password. Each user gets a randomly generated password that meets the current password policy in effect (if any). You can view or download the passwords when you get to the Final page.

    • Custom password. Each user is assigned the password that you enter in the box.

  5. Choose Next: Permissions.

  6. On the Set permissions page, choose Add user to group. Select the check box next to the group that you created earlier and choose Next: Review.

  7. Choose Create user.

  8. To view the users' access keys (access key IDs and secret access keys), choose Show next to each password and secret access key to see. To save the access keys, choose Download .csv and then save the file to a safe location.


    You cannot retrieve the secret access key after you complete this step; if you misplace it you must create a new one.

  9. Choose Close.

  10. Give each user his or her credentials (access keys and password); this enables them to use services based on the permissions you specified for the IAM group.

For more information about IAM, see the following: