Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get an error when trying to add an SNS trigger to my AWS Lambda function?

I'm trying to setup an AWS Lambda function that gets triggered when a CloudWatch alarm sends a message to an SNS topic. I'm following along in this guide:

https://medium.com/analytics-vidhya/generate-slack-notifications-for-aws-cloudwatch-alarms-e46b68540133

I'm stuck at step 6 at the point where it says to add the trigger to the function. I select my SNS topic as the trigger but when I hit Add it gives me the following error:

An error occurred when creating the trigger: Invalid parameter: Invalid protocol type: lambda (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: 343350ee-b514-5c7c-8180-08fe5fd643ec; Proxy: null)

enter image description here

Does anybody know what that error means and what I can do about it?

Thanks

like image 251
gib65 Avatar asked Oct 26 '20 16:10

gib65


People also ask

Can AWS SNS trigger Lambda?

Amazon SNS and AWS Lambda are integrated so you can invoke Lambda functions with Amazon SNS notifications. When a message is published to an SNS topic that has a Lambda function subscribed to it, the Lambda function is invoked with the payload of the published message.

What tool lets you send an Amazon SNS notification or invoke an AWS Lambda function based on your AWS CloudTrail logs?

You can take advantage of Amazon S3's bucket notification feature and direct Amazon S3 to publish object-created events to AWS Lambda. Whenever CloudTrail writes logs to your S3 bucket, Amazon S3 can then invoke your Lambda function by passing the Amazon S3 object-created event as a parameter.


1 Answers

I ran into this problem recently...

As of now, Lambda only supports Standard SNS topics.

You will need to change your SNS topic from FIFO to Standard.

like image 62
DanielWsk Avatar answered Oct 22 '22 10:10

DanielWsk