-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
47 lines (41 loc) · 1.06 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
service: prismic-lambda-webhook
plugins:
- serverless-plugin-optimize
package:
individually: true
provider:
name: aws
runtime: nodejs6.10
memorySize: 128
stage: ${opt:stage,self:custom.defaults.stage}
region: ${opt:region,self:custom.defaults.region}
profile: ${opt:profile,env:AWS_PROFILE,self:custom.defaults.profile}
environment: ${file(./${opt:env,self:custom.defaults.env}.yml)}
iamRoleStatements:
- Effect: Allow
Action:
- sns:ListTopics
- sns:CreateTopic
- sns:Publish
- sns:Subscribe
Resource:
- arn:aws:sns:${self:provider.region}:*:PRISMIC_LAMBDA_WEBHOOK
custom:
defaults:
stage: dev
region: eu-central-1
env: env
profile: default
functions:
webhook:
description: Handle Prismic.io webhook post and send SNS notification
handler: functions/webhook.handle
events:
- http: POST webhook
# EXAMPLE handler
build:
description: Run simple lambda triggered by SNS event
handler: functions/build.handle
events:
- sns: PRISMIC_LAMBDA_WEBHOOK