-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
66 lines (62 loc) · 1.58 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
service: assistant-service
provider:
name: aws
runtime: nodejs8.10
stage: ${env:GDL_ENVIRONMENT, 'test'}
region: eu-central-1
endpointType: private
role: arn:aws:iam::${env:GDL_ACCOUNT, 'DEV'}:role/${env:SERVERLESS_IAM_ROLE, 'DEV'}
environment:
GDL_ENVIRONMENT: ${env:GDL_ENVIRONMENT, 'dev'} #Our server didn't get process.env.GDL_ENVIRONMENT without doing this..
tags:
VERSION: "1.0.0"
deploymentBucket:
name: ${env:GDL_SERVERLESS_DEPLOYMENT_BUCKET, 'DEV'}
resourcePolicy:
- Effect: Allow
Principal: "*"
Action: execute-api:Invoke
Resource:
- execute-api:/*/*/*
Condition:
StringEquals:
aws:SourceVpce:
- "${env:VPC_ENDPOINT, 'DEV'}"
package:
individually: true
exclude:
- ./**
- '!node_modules/**'
functions:
assistant:
handler: functions/app.handler
description: "Google assistant API for reading books"
events:
- http:
method: POST
path: /
- http:
method: GET
path: /health
package:
include:
- package.json
- functions/**/*.js
- functions/*.js
exclude:
- '**__tests__/**'
custom:
warmup:
enabled:
- prod
vpc:
vpcName: ${env:VPC, 'DEV'}
subnetNames:
- "${env:GDL_ENVIRONMENT, 'DEV'}.private_a.gdl"
- "${env:GDL_ENVIRONMENT, 'DEV'}.private_b.gdl"
securityGroupNames:
- "serverless-security_group"
plugins:
- serverless-plugin-warmup
- serverless-vpc-discovery
- serverless-offline #!OBS: serverless-offline needs to be last in the list