Regarding IAM role

0

If i delete an iam role without terminating instances under that IAM role. will the instances running on it automatically deleted once we delete the iam role or whether it will be present somewhere else.

profile picture
已提問 1 年前檢視次數 292 次
2 個答案
0
已接受的答案

Hi

No, it will not terminate the instance. But, deleting a role or instance profile that is associated with a running instance will break any applications that are running on the instance.

Hence its recommended to secure an application downtime [on the affected EC2 instance], detach the IAM role from the instance profile, attach a new IAM role to the instance profile and then delete the old IAM role.

For further reading: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage_delete.html

Also, Instances do not run under an IAM user. IAM only specifies how users/groups/roles get access to AWS Resources/Services. The services/resources, EC2 in this example will have no effect if some user/group/role doesn't have access to manage it.

Thanks

profile pictureAWS
Rama
已回答 1 年前
  • sorry to say that there is a correction in aforementioned question. i meant that IAM user not IAM role. if i delete an IAM user without terminating instances running under that IAM user will it be automatically terminated or not. or do we need to terminate the instance first and then only we can proceed with the IAM user deletion.

  • Thanks for your response

0

Deleting an IAM role used by an EC2 instance does not make the EC2 instance disappear.
You will not be moved anywhere, but since the IAM role will disappear, you will not be able to perform AWS operations that you were able to perform from the EC2 instance.

profile picture
專家
已回答 1 年前
  • sorry to say that there is a correction in aforementioned question. i meant that IAM user not IAM role. if i delete an IAM user without terminating instances running under that IAM user will it be automatically terminated or not. or do we need to terminate the instance first and then only we can proceed with the IAM user deletion.

  • Deleting an IAM user does not terminate EC2.

  • Instances do not run under an IAM user. IAM only specifies how users/groups/roles get access to AWS Resources/Services. The services/resources, EC2 in this example will have no effect if some user/group/role doesn't have access to manage it.

  • Thanks for your response.Rama&Riku_Kobayashi

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南