Amazon Elastic Compute Cloud
User Guide for Linux (API Version 2014-10-01)
Did this page help you?  Yes | No |  Tell us about it...
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.

Controlling Access to Amazon EC2 Resources

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 Authorizing Inbound Traffic for Your Linux 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 Making an AMI Public.

Each Amazon EBS snapshot has a createVolumePermission attribute that controls which AWS accounts can use the snapshot. For more information, see Sharing 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?

Creating an IAM Group and Users

To create an IAM group

  1. Sign in to the AWS Management Console and open the IAM console at

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

  3. In the Group Name box, type a name for your group, and then click Next Step.

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

    • PowerUserAccess

    • ReadOnlyAccess

    • AmazonEC2FullAccess

    • AmazonEC2ReadOnlyAccess

  5. Click Next Step and then click 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, click Users and then click Create New Users.

  2. In box 1, type a user name and then click Create.

  3. Click Download Credentials and save your access key in a secure place. You will need your access key for programmatic access to AWS using the AWS CLI, the AWS SDKs, or the HTTP APIs.


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

    After you have downloaded your access key, click Close.

  4. Under User Name, click the name of the user you just created.

  5. Click Groups and then click Add User to Groups.

  6. Select the group you created earlier, and then click Add to Groups.

  7. Click Security Credentials and then under Sign-In Credentials, click Manage Password.

  8. Select Assign a custom password and then type and confirm a password. When you are finished, click Apply.

  9. 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: