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
                );
              }
            });
질문됨 2년 전221회 조회
1개 답변
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
지원 엔지니어
Rajil_P
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠