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
                );
              }
            });
gefragt vor 2 Jahren222 Aufrufe
1 Antwort
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!

AWS
SUPPORT-TECHNIKER
Rajil_P
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen