From the course: AWS Essential Training for Developers

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

IAM roles for EC2

IAM roles for EC2

- Do you remember that I said not to place your access keys directly into a server? (key plops) Well, to get my code to work, I put my access key with all of its administrative permissions directly onto our test server, but now my access key could be compromised if anything ever happens to this server. So, how do I prevent this key from getting stolen? IAM, or Identity Access Management, has a feature called Roles. By creating an IAM Role, I can tell AWS what permissions this EC2 instance has. In our example, I can use a role to grant read and write permissions to my S3 buckets and apply that role to my instances. Since this role is a property of the instance, it's like the instance type. There's no keys or passwords on the server that can now be stolen. Let's create a new role from our EC2 instance and fix our code. AWS console, in the Services menu, type IAM and click on the IAM entry. On the left-hand sub…

Contents