Niamh shows you how to
assign an IAM role
to a running AWS instance


I have an Identity and Access Management (IAM) role that I want to assign to an Amazon Elastic Compute Cloud (Amazon EC2) instance. How can I do this?

  1. In the Amazon EC2 console, choose Instances from the navigation pane.
  2. Select the instance that you want to attach the IAM role to, choose Actions, Instance Settings, and then choose Attach/Replace IAM role.
  3. For IAM role, choose your IAM role, and then choose Apply.
  4. You should see a message that the IAM role operation succeeded. Choose Close.

The IAM role is now assigned to your running EC2 instance.

Note: If you are adding an IAM role to an EC2 instance for use with AWS Systems Manager, you might need to restart the SSM Agent, or wait for the AWS Systems Manager Agent (SSM Agent) to detect the new IAM role. For more information, see Systems Manager Prerequisites.

For more information, see Using an IAM Role to Grant Permissions to Applications Running on Amazon EC2 Instances.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2017-08-02

Updated: 2018-03-06