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年前209ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ