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 Identity and Access Management (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 Add user.
Enter a user name.
Select the type of access this set of users will have. Select both Programmatic access and AWS Management Console access.
For Console password type, 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 type in the box.
Choose Next: Permissions .
On the Set permissions page, choose Add user to group. Select the group you created earlier.
Choose Next: Review, then Create user.
To view the users' access keys (access key IDs and secret access keys), choose Show next to each password and secret access key that you want 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.
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.