Last active
February 4, 2020 05:10
-
-
Save RishiRajSahu/1871c8e743b65cbcf647328174049109 to your computer and use it in GitHub Desktop.
serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Welcome to Serverless! | |
# | |
# This file is the main config file for your service. | |
# It's very minimal at this point and uses default values. | |
# You can always add more config options for more control. | |
# We've included some commented out config examples here. | |
# Just uncomment any of them to get that config option. | |
# | |
# For full config options, check the docs: | |
# docs.serverless.com | |
# | |
# Happy Coding! | |
service: aws-sns-lambda-integration | |
# app and org for use with dashboard.serverless.com | |
#app: your-app-name | |
#org: your-org-name | |
# You can pin your service to only deploy with a specific Serverless version | |
# Check out our docs for more details | |
# frameworkVersion: "=X.X.X" | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
profile: <AWS_PROFILE_NAME> | |
iamRoleStatements: | |
- Effect: "Allow" | |
Action: | |
- "SNS:Publish" | |
Resource: "arn:aws:sns:us-east-1:<AWS_ACCCOUNT_ID>:sns-lambda-events" | |
environment: | |
# AWS configuration | |
ACCESS_KEY_ID: <AWS_ACCESS_KEY_ID> | |
SECRET_ACCESS_KEY: <AWS_SECRET_ACCESS_KEY> | |
REGION: us-east-1 | |
# SNS Configuration | |
SNS_REGION: us-east-1 | |
SNS_ACCOUNT_ID: <AWS_ACCCOUNT_ID> | |
# SNS Topics | |
SNS_LAMBDA_EVENTS_TOPIC: sns-lambda-events | |
functions: | |
publish_lambda_events: | |
handler: src/functions/publisherLambda.handler | |
description: Handles publish events | |
events: | |
- http: | |
path: publisherLambda | |
method: post | |
target_lambda_events: | |
handler: src/functions/targetLambda.handler | |
description: target lambda to be exucuted on SNS event | |
events: | |
- sns: sns-lambda-events |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment