robbwagoner / aws-lambda-sns-to-slack Goto Github PK
View Code? Open in Web Editor NEWSend SNS events to Slack with AWS Lambda function
License: Apache License 2.0
Send SNS events to Slack with AWS Lambda function
License: Apache License 2.0
This is currently one of my favorite Lambda functions, but I am python deficient... and I've been struggling with getting it to format S3 puts. Would you mind providing some guidance on adding aws:s3 as an event source when coming through SNS?
Just grabbed your very nifty lambda script and in attempting to get things running, I hit the following snag when attempting to test using the SNS example message on Lambda. Local test message that you provide seems to work.
Debug message just before the json.loads on line 106 prints correctly. Line numbers will be slightly off from your version as I am in process of adding KMS encrypted URL support.
{
"stackTrace": [
[
"/var/task/lambda_function.py",
106,
"lambda_handler",
"json_msg = json.loads(sns['Message'])"
],
[
"/usr/lib64/python2.7/json/__init__.py",
338,
"loads",
"return _default_decoder.decode(s)"
],
[
"/usr/lib64/python2.7/json/decoder.py",
366,
"decode",
"obj, end = self.raw_decode(s, idx=_w(s, 0).end())"
],
[
"/usr/lib64/python2.7/json/decoder.py",
384,
"raw_decode",
"raise ValueError(\"No JSON object could be decoded\")"
]
],
"errorType": "ValueError",
"errorMessage": "No JSON object could be decoded"
}
START RequestId: efb532d1-bf1b-11e5-a05d-1f0bb4c94980 Version: 4
DEBUG: Hello from SNS!
No JSON object could be decoded: ValueError
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 106, in lambda_handler
json_msg = json.loads(sns['Message'])
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
END RequestId: efb532d1-bf1b-11e5-a05d-1f0bb4c94980
REPORT RequestId: efb532d1-bf1b-11e5-a05d-1f0bb4c94980 Duration: 0.58 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 16 MB
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.