18 Dec 2023 04:30 PM - edited 19 Dec 2023 08:37 AM
An error might occur when attaching a role to an EC2 instance. In such cases, you can use curl
to retrieve the instance metadata to verify if the role is listed there. Use the following command:
curl http://169.254.169.254/latest/meta-data/iam/info
If the attached role is still not listed in the instance metadata, it often helps to reattach it.
For more information, see Instance Metadata and User Data.