vendredi 3 juillet 2015

AWS: cannot access DynamoDB from EC2

I have and nodejs application which is running on EC2 instance. Whenever the application requests DynamoDB (via aws-sdk) i get this response:

<InvalidSignatureException> <Message>Credential should be scoped to correct service: 'elasticbeanstalk'. </Message> </InvalidSignatureException>

The EC2 instance is created with default profile. And i tried to attach policies to the profile granting full access to DynamoDB and IAM. No luck.

I found this article on aws-docs http://ift.tt/1AEtece

And seems there is described exactly the issue i am experiencing. But i still do not get how to fix it.

Regarding credentials, i rely on aws-sdk which is requesting temporary credentials and i dont use any local config for credentials.

There is something strange in the response that results in the error i mentioned. It`s authorization header look like: Credential=SOME_KEY_HERE/20150703/us-west-2/dynamodb/aws4_request

but the host is: host: 'elasticbeanstalk.us-west-2.amazonaws.com'

May be it is the cause of the problem?

I am new to AWS, and i will really appreciate any help! I read docs about IAM Roles, but still have no luck with the issue. =(




Aucun commentaire:

Enregistrer un commentaire