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

前端 未结 5 1864
时光说笑
时光说笑 2021-02-12 22:44

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.

5条回答
  •  梦谈多话
    2021-02-12 23:27

    if you are getting "The association is not the active association" error when trying to attach a role to a existing EC2 instance then you should:

    1. detach the existing role from the existing EC2 instance.
    2. attach a new role to the existing EC2 instance.
    

    once you do that, you will be able to attach a role to an existing EC2 instance.

提交回复
热议问题