Blu Age L3 - IAM instance profile doesn't appear while creating EC2

0

Chapter: Go Live > Create > Elastic File System > Create EC2 Linux

There is a step which states "Select aws-bluage-l3-workshop-efs-role as IAM instance profile", however the "IAM instance profile" never appeared in the dropdown for me.

asked a month ago73 views
1 Answer
0
Accepted Answer

Note: I am writing the answer to my own question as I found the solution to it, and anyone facing the same issue may benefit from this.

My first guess was that I didn't create the "IAM role" correctly as stated in the previous step. So I deleted it and recreated the "IAM role". But it didn't resolve the issue.

Next, I thought it may be a matter of "IAM role" not being reflected, so I signed out of AWS console and signed back in. No luck with this either.

After going through several web searches and blogs, I got to know that...

  • whenever we create a "IAM role" for EC2 through console, a "IAM instance profile" should also get created automatically
  • however, in some cases due to a glitch, the "IAM instance profile" doesn't get created
  • in that case, we should create the profile from CLI

So, I ran below two commands in the CLI to create an instance profile and then add the role to the instance profile respectively.

  1. aws iam create-instance-profile --instance-profile-name aws-bluage-l3-workshop-efs-role
  2. aws iam add-role-to-instance-profile --role-name aws-bluage-l3-workshop-efs-role --instance-profile-name aws-bluage-l3-workshop-efs-role

Only then the profile started to appear in the dropdown.

answered a month ago