-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
73 lines (67 loc) · 2.04 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
67
68
69
70
71
72
73
service: service-name
provider:
name: aws
runtime: nodejs12.x
stage: ${opt:stage, 'staging'} # i.e. default to staging if no --stage command line option is provided.
region: eu-west-1
endpointType: edge
iamRoleStatements:
# Enable functions to read any parameter in a folder matching its service name
- Effect: Allow
Action:
- ssm:GetParameter
Resource:
- arn:aws:ssm:${self:provider.region}:*:parameter/${self:service}/*
environment:
STAGE: ${self:provider.stage}
ENVIRONMENT: ${self:provider.stage}
EXAMPLE_ENDPOINT: ${self:custom.${self:provider.stage}.EXAMPLE_ENDPOINT}
plugins:
- serverless-domain-manager
custom:
# For variables which are different from staging vs production
staging:
EXAMPLE_ENDPOINT: "https://staging.example.com"
certificateArn: "arn:aws:staging-certificate-arn"
domainName: my-service.staging.my-staging-domain.com
production:
EXAMPLE_ENDPOINT: "https://example.com"
certificateArn: "arn:aws:production-certificate-arn"
domainName: my-service.production.my-production-domain.com
# serverless-domain-manager
# https://github.com/amplify-education/serverless-domain-manager
customDomain:
domainName: ${self:custom.${self:provider.stage}.domainName}
basePath: ""
stage: ${self:provider.stage}
certificateArn: ${self:custom.${self:provider.stage}.certificateArn}
createRoute53Record: true
endpointType: "edge"
securityPolicy: tls_1_2
functions:
getExample:
handler: services/getExample.handler
events:
- http:
path: /example
method: get
cors: true
postExample:
handler: services/postExample.handler
events:
- http:
path: /example
method: post
cors: true
pathParamExample:
handler: services/pathParamExample.handler
events:
- http:
path: /examples/{id}
method: get
cors: true
request:
parameters:
paths:
orgId: true
name: true