forked from rangle/stripe-eventbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
43 lines (38 loc) · 1.14 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
service: stripe-eventbridge
frameworkVersion: ">=1.54.0 <2.0.0"
provider:
name: aws
runtime: nodejs10.x
memorySize: 256
stage: dev
region: us-east-1
endpointType: EDGE
logs: # Enable CloudWatch logs
restApi: true
tracing: # Enable X-Ray tracing
apiGateway: true
iamRoleStatements:
- Effect: "Allow"
Action:
- "secretsmanager:GetSecretValue"
Resource: "${cf:stripe-eventbridge-deps-${self:provider.stage}.StripeWebhookSecretArn}"
- Effect: "Allow"
Action:
- "sns:Publish"
Resource: ${cf:stripe-eventbridge-deps-${self:provider.stage}.SNSTargetForFailedEvents}
- Effect: "Allow"
Action:
- "events:PutEvents"
Resource: "*"
functions:
stripe-webhook:
handler: handler.stripeWebhook
events:
- http:
path: stripe/webhook
method: post
async: false
environment:
FAILURE_SNS: ${cf:stripe-eventbridge-deps-${self:provider.stage}.SNSTargetForFailedEvents}
EVENT_BRIDGE: "default"
ENDPOINT_SECRET: "${cf:stripe-eventbridge-deps-${self:provider.stage}.StripeWebhookSecretArn.Name}"