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

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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ