【问题标题】:Credentials should be scoped to a valid region凭证的范围应为有效区域
【发布时间】:2019-10-31 14:08:54
【问题描述】:

当我不使用 AWS SES 时,下面的代码运行良好

const AWS = require('aws-sdk');
AWS.config.update({region: 'ap-northeast-2'});
const s3 = new AWS.S3({apiVersion: '2006-03-01'});

但在我使用 ap-southeast-2 端点(悉尼)添加 SES 代码后,突然无法使用凭据应该限定在有效区域,而不是“ap-northeast-2”错误消息

const ses = new AWS.SES({
  apiVersion: '2010-12-01',
  endpoint: 'https://email.ap-southeast-2.amazonaws.com'
});

有什么解决办法吗?请问我需要一些帮助

【问题讨论】:

    标签: javascript node.js amazon-web-services aws-sdk


    【解决方案1】:

    我在构建 ses 对象时添加了区域字段 效果很好。

    const ses = new AWS.SES({
      region: 'ap-southeast-2'
    });
    

    【讨论】:

      猜你喜欢
      • 2014-08-27
      • 2017-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多