Monday, June 18, 2018

AWS Error - com.amazonaws.SdkClientException: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/


1. ERROR:

com.amazonaws.SdkClientException: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/
        at com.amazonaws.internal.EC2CredentialsUtils.readResource(EC2CredentialsUtils.java:117) ~[dg-cloud-agent-assembly-0.1.0.jar:0.1.0]
        at com.amazonaws.internal.EC2CredentialsUtils.readResource(EC2CredentialsUtils.java:79) ~[dg-cloud-agent-assembly-0.1.0.jar:0.1.0]
        at com.amazonaws.auth.InstanceProfileCredentialsProvider$InstanceMetadataCredentialsEndpointProvider.getCredentialsEndpoint


Cause:
1. You do not have any Role attached to the EC2 instance.
2. The role attached does not have required permission to perform the reuquired action, on behalf of EC2 instance.

Things to remember:
It is not a good practise to store your credentials, such as AWS access key in your EC2 instance.
Thus, it is preferred to attach a Role to an EC2 instance, if you want to perform certain actions through the applications on your EC2 instance.

9 comments:

My GutHub basics and cheat sheat

used for Source control management (SCM). Following are the few things you need to know: 1. cloning - pulling down the copy of the sour...