Function won't fire - Unclear documentation of required ARN topic format
See original GitHub issueI had this same issue as #24 (by @Siyfion) and had to dig in to figure out what the issue was. The documentation isn’t 100% clear on this, but your code sample and some source code inspection confirmed it, when you publish a message you HAVE to use an ARN containing the Amazon account ID 123456789012
.
e.g., format of TopicArn
must be equal to arn:aws:sns:us-east-2:123456789012:TopicName
I was trying to publish to topic “TopicName” and not including a fully formatted ARN (Since it didn’t make sense in the context of a local SNS… what would the region / account ID be?).
Requests:
- Update readme to be clear that the published topic MUST match this format
- Have a warning show up in the serverless offline console when it received a message that it couldn’t handle, and possibly list the available topics that it can process to aid diagnosing this issue
- Alternatively, it would be nice to removed the need for a fully qualified ARN entirely since the SNS client library itself doesn’t require a fully qualified ARN (at least the
aws-sdk
NPM client does not) – e.g., allow the client to send toTopicArn: "TopicName"
instead ofTopicArn: "arn:aws:sns:us-east-2:123456789012:TopicName"
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Formatting a notification by using an AWS Lambda function
This tutorial demonstrates how to send MQTT message data to an AWS Lambda action for formatting and sending to another AWS service. In...
Read more >AWS API-Gateway communicating to SNS - Stack Overflow
If anybody is still looking for a solution to the original problem, proxying a JSON request body to an SNS topic via API...
Read more >Good documentation practice in clinical research - PMC - NCBI
First, the site was following a different practice for documenting progress for clinical research subjects. Were the subjects' records missing any elements ......
Read more >Resource functions for ARM templates - Azure - Microsoft Learn
Describes the functions to use in an Azure Resource Manager template (ARM template) to retrieve values about resources.
Read more >FY2022 April1 update ICD-10-CM Guidelines - CMS
diagnosis codes is required under the Health Insurance Portability and Accountability Act ... such documentation accurate coding cannot be achieved.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
in my case, following the 1st example on the official docs
Does not trigger the subscribed function.
following the 2nd convention on the official docs, is the one that works
Would you consider supporting the 1st one, or as suggested earlier improve documentation to note that 1st option from the docs is not yet supported?
Following up on @shierro’s comment, if the snsConfig is a string, the plugin assumes this is the topicName, but Serverless docs require this to be the ARN:
Here you can see the docs show it as the ARN and you will actually get an error when trying to deploy if this is not set correctly: https://serverless.com/framework/docs/providers/aws/events/sns#using-a-pre-existing-topic