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,440 points
94 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,090 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
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,090 points
452 views
+1 vote
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,090 points
307 views
+1 vote
2 answers

How to launch and access an instance using AWS-CLI?

aws ec2 run-instances --image-id ami-id --key-name yourkeyname ...READ MORE

answered Feb 23 in AWS by Shashank
• 1,350 points
126 views
0 votes
1 answer

How to Pass the VPC ID while creating the Ec2 instance in AWS using Python Boto3

import boto3 ec2 = boto3.resource('ec2') instance = ec2.create_instances( ...READ MORE

answered Jan 29 in AWS by Priyaj
• 56,520 points
285 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,090 points
183 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,090 points
95 views