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,530 points
857 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

0 votes
1 answer

How to add a role to an instance profile in AWS?

Hi@akhtar, You can add the specified IAM role ...READ MORE

answered Nov 3, 2020 in AWS by MD
• 95,180 points
60 views
0 votes
1 answer

How to add AWS tags to an existing repository in AWS CodeCommit?

Hi@akhtar, You can add or update tags for a resource ...READ MORE

answered Nov 25, 2020 in AWS by MD
• 95,180 points
68 views
+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, 2020 in AWS by MD
• 95,180 points
218 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, 2020 in AWS by MD
• 95,180 points
235 views
0 votes
1 answer

How to create an access key for an IAM user in AWS?

Hi@akhtar, You can create a new AWS secret ...READ MORE

answered Nov 3, 2020 in AWS by MD
• 95,180 points
80 views
0 votes
1 answer

How to attach a volume to an instance in AWS?

Hi@akhtar, You can attach an EBS volume to a ...READ MORE

answered Nov 5, 2020 in AWS by MD
• 95,180 points
57 views
0 votes
1 answer

How to attach an instance to an Auto Scaling group in AWS?

Hi@akhtar, You can attach one or more EC2 instances ...READ MORE

answered Nov 26, 2020 in AWS by MD
• 95,180 points
71 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,411 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
546 views