I have serverless.yaml with many SNS topics that I need to build ARNs from names across accounts and regions, so I come with a custom prefix
custom:
snsTopicPrefix:
Fn::Join:
- ":"
- - "arn:aws:sns"
- !Ref "AWS::Region"
- !Ref "AWS::AccountId"
topic01: Topic-01-test
functions:
from-SNS:
handler: src/fromSNS/handler.fromSNS
events:
- sns:
arn: ${self:custom.snsTopicPrefix}:${self:custom.topic01}
topicName: ${self:custom.topic01}
however, when I deploy it I can not pass an error Trying to populate non string value into a string for variable ${self:custom.snsTopicPrefix}. Please make sure the value of the property is a string.