Getting InvalidSignatureException: Forbidden Error When deployed my dockerized Pinpoint Application on EC2.

0

I have built an app that creates pinpoint endpoints using aws-sdk and it's working perfectly in my local machine and local docker container but when i deployed the same application on EC2 using docker it's giving me this "Forbidden" Error. why? i mean if it's working fine locally it should work live as well.

const AWS = require('aws-sdk');

AWS.config.update({
    secretAccessKey: process.env.AWS_SECRET_ACCESS,
    accessKeyId: process.env.AWS_ACCESS_KEY,
    region: 'ap-southeast-2',
  });

const pinpoint = new AWS.Pinpoint();
pinpoint.updateEndpoint(params, function (err, data) {
              if (err) {
                logger.info('An error occurred.\n');
                logger.info(err, err.stack);
              } else {
                logger.info(
                  '>> Endpoint added/pushed Successfully with endpoint ID ' + obj_id
                );
              }
            });
asked 3 months ago34 views
1 Answer
0

Hello,

Its possible that a different IAM entity is being made use of to perform the API call. When the SDK for JavaScript loads, it automatically searches the shared credentials file, which is named "credentials"[1]. Here is the precedence order for NodeJS applications[2]. To find out the identity of the caller, try a GetCallerIdentity call[3] to log the IAM identity making the call on your instance/application.

[1] https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html [2] https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html [3] https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html

Feel free to raise a support case with the IAM team to perform resource specific troubleshooting. Thanks!

SUPPORT ENGINEER
Rajil_P
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions