IAM role is not showing on ec2 instance profile

I have created a role with cloudwatch access and tried to attach to my ec2 instance. But in the security tab it is showing “No roles attached to instance profile: ec2-role”.

Attaching the error screenshot:

You can check the instance profile:
Ensure the instance profile is correctly associated with the IAM role. Go to the IAM dashboard, select Roles, and then click on the role you created.
Verify that the Trust relationships tab shows the trust policy allowing EC2 to assume the role.

The below is the trust policy that is the role having:

Maybe try reapplying the policy and restarting the EC2 instance.

Okay, I will give a try and let you know.

The role is created but this is the error I am getting while creating IAM role:

Oh you are using the playground. A lot of IAM stuff is not supported in the KodeKloud AWS Playground.

Oh ok, so this type of testing I need to do in my personal account?

Yes for IAM activities I would use a personal AWS account.

1 Like