How to add IAM role to an existing instance in aws?

0 votes

I would like to add an IAM Role to an existing EC2 instance in AWS. I tried using AWS CLI, however I could not find a way to do that.

Sep 6, 2018 in AWS by datageek
• 2,490 points
648 views

1 answer to this question.

0 votes

As of AWS CLI v1.11.46,  you can now attach an IAM role to an existing EC2 instance that was originally launched without an IAM role using the associate-iam-instance-profile command.

You can also replace the currently attached IAM role for a running instance using replace-iam-instance-profile-association.

answered Sep 6, 2018 by Archana
• 4,150 points

Related Questions In AWS

+1 vote
2 answers
+1 vote
1 answer

How to create an IAM user in AWS?

Hi@akhtar, To create new user in AWS, you ...READ MORE

answered Jun 1 in AWS by MD
• 65,200 points
119 views
0 votes
1 answer

How to create an AWS EC2 Instance in the VPC with Boto3 module?

Hi@akhtar, You can use a network interface in ...READ MORE

answered Oct 10 in AWS by MD
• 65,200 points
58 views
0 votes
1 answer
+1 vote
1 answer

How to auto-scale MYSQL database in AWS EC2 instance?

You could always use the Amazon RDS ...READ MORE

answered Aug 24, 2018 in AWS by Archana
• 4,150 points
955 views
+2 votes
1 answer
0 votes
1 answer

How do I add python libraries to an AWS lambda function for Alexa?

As it is described in the Amazon ...READ MORE

answered Oct 23, 2018 in AWS by Archana
• 4,150 points
6,548 views
0 votes
1 answer

How to launch an EC2 instance with IAM-Role?

The credentials you are using from your ...READ MORE

answered Sep 3, 2018 in AWS by Archana
• 4,150 points
1,120 views
0 votes
1 answer

How to Restrict AWS Resource Access to a Specific IAM Role

You can use iam get-role to find the Role-Id and add ...READ MORE

answered Aug 13, 2018 in AWS by Archana
• 4,150 points
401 views