AWS 10DLC 跨账户

AWS 10DLC cross account

我在账户 A 中有一个 lambda 函数,SNS topics/subscriptions,我在账户 B 中有一个 10DLC campaign/number

我如何让 lambda 函数能够传递原始 ID,以便我可以使用 10DLC 编号?现在我正在使用 SDK v2 并使用发布方法。我知道我还需要承担一个角色——我现在承担的是正确的吗,因为我承担了来自账户 B 的精确发送角色——我的 lambda 将无法使用来自账户 A 的 SNS topic/subscription?

我在这里看到这些道具:AWS.MM.SMS.OriginationNumber 来自 https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html#sms_publish_sdk

但是在 SDK v3 文档页面上找不到使用它的地方

我不能说你问题的角色部分,但就使用原始号码而言,我可以举个例子,因为我昨天刚设置好。

下面是发送短信时指定来源号码的节点示例:

const AWS = require('aws-sdk')
AWS.config.update({ region: 'us-east-1' })
const SNS = new AWS.SNS({ apiVersion: '2010-03-31' })

const params = {
  Message: "This is the message you are sending",
  PhoneNumber: "+13334445555", // This is the receiving number
  MessageAttributes: {
    'AWS.SNS.SMS.SMSType': {
      DataType: 'String',
      StringValue: 'Transactional' // Can also be set as Promotional
    },
    'AWS.MM.SMS.OriginationNumber': {
      DataType: 'String',
      StringValue: "+15556667777" // This is the send number
    }
  }
}

return SNS.publish(params).promise()