UNPKG

sls-helper-plugin-janis

Version:

A Serverless Helper plugin to add custom helpers for Janis Commerce

19 lines (13 loc) 420 B
'use strict'; const { snsTopicScopes } = require('../../utils/sns-topic-scopes'); const baseArn = 'arn:aws:sns:${aws:region}'; module.exports = topicConfig => { if(topicConfig.scope === snsTopicScopes.remote) { return { topic: `${baseArn}:\${self:custom.awsAccountsByService.${topicConfig.serviceCode}}:${topicConfig.name}` }; } return { topic: `${baseArn}:\${aws:accountId}:${topicConfig.name}` }; };