IAM could not create an EC2 role due to the absence of an instance-profile ARN

1

Hello, I need assistance with creating a new EC2 role. According to the documentation, I should create a new role from IAM and select EC2 under AWS service. However, after creating the role, there is no instance-profile ARN. The IAM user is an administrator with full access. Is there an issue?

Documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

Kishore
已提问 1 个月前97 查看次数
1 回答
2
已接受的回答

I haven't created instance profiles via the console in a while, but since you already have your role created, you can create an EC2 instance profile and attach it to your existing role by launching CloudShell and running the following commands. Be sure to replace "EC2RoleForMyServer" with the name of your role:

aws iam create-instance-profile --instance-profile-name EC2RoleForMyServer
aws iam add-role-to-instance-profile --instance-profile-name EC2RoleForMyServer --role-name EC2RoleForMyServer
profile picture
已回答 1 个月前
profile picture
专家
已审核 1 个月前
profile picture
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则