question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Function won't fire - Unclear documentation of required ARN topic format

See original GitHub issue

I 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:

  1. Update readme to be clear that the published topic MUST match this format
  2. 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
  3. 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 to TopicArn: "TopicName" instead of TopicArn: "arn:aws:sns:us-east-2:123456789012:TopicName"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
shierrocommented, Dec 20, 2018

in my case, following the 1st example on the official docs

someNiceFunction:
    events:
      - sns: arn:aws:sns:ap-southeast-2:13135XXXXXXXXX:update-user-prod

Does not trigger the subscribed function.

following the 2nd convention on the official docs, is the one that works

someNiceFunction:
    events:
      - sns:
          arn: arn:aws:sns:ap-southeast-2:13135XXXXXXXXX:update-user-prod

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?

1reaction
jkruse14commented, Feb 21, 2019

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:

offline-sns-issue

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found