Just to clarify. When the sns Topic gets a message, you want it to invoke a Lambda function to process the message that was sent to the SNS topic. If yes, then you want to create your Cloudformation template to look something like the following:
Parameters: MyLambdaArn: Type: String Default: arn:aws:lambda:us-east-1:XXXXXXXXXX:function:MyLambda Description: Enter the Lambda ARN Resources: lambdaTopic: Type: AWS::SNS::Topic Properties: DisplayName: Topic that invokes the Lambda function Subscription: - Endpoint: !Ref MyLambdaArn Protocol: lambda lambdaPermission: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: !Ref MyLambdaArn Principal: sns.amazonaws.com SourceArn: arn:aws:sns:eu-west-1:643462973525:mytopic
Hope that helps.
Edited by: rtakeshi on Aug 7, 2019 10:05 AM
OK, I had use this solution first.
The SNS topic has created by an other teams but it make sens that the Lambda creation section must be present in their cloudformation file.
Very thanks !
- Accepted Answerasked 4 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 8 months ago
- How do I create a subscription between my Amazon SQS queue and an Amazon SNS topic in CloudFormation?AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- EXPERTpublished a year ago
- EXPERTpublished 5 months ago