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
Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/.
In the navigation pane, choose Groups and then choose Create New Group.
In the Group Name box, enter a name for your group, and then choose Next Step.
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:
Choose Next Step and then 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
In the navigation pane, choose Users and then choose Create New Users.
In box 1, enter a user name and then choose Create.
Choose 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, choose Close.
Under User Name, choose the name of the user you just created.
In the Groups tab, choose Add User to Groups.
Select the group you created earlier, and then choose Add to Groups.
Choose Security Credentials and then Manage Password.
Select Assign a custom password and then enter and confirm a password. When you are finished, choose Apply.
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