I’m trying to do something like shown below. Create a lambda which handles notifications from a sns topic, and a lambda used to published to the same topic.
How can I get the SNS ARN set to snsAlertPublisher lambda ?
I’m pretty new to serverless and this might be a dumb question, { "Fn::Join" : ["", ["arn:aws:sns:${self:custom.region}:", { "Ref" : "AWS::AccountId" }, ":${self:custom.alertDispatchTopic}" ] ] } yields an object during runtime that lacks the account ID (i.e. it just has { "Ref" : "AWS::AccountId" }). How do you get this to reduce out to a string?
I should note that I’m testing this in serverless-offline so that might affect this as well.
@johnhaley81 It’s Cloud Formation syntax that’s resolved during deployment. If you’re using serverless-offline then it probably won’t work. You could try using different environment variables for each stage (see this) then use that syntax for prod and put the ARN for an SNS topic you manually created into development.