-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
64 lines (58 loc) · 1.54 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
service: canibuybeer
custom:
local: local
deployStage: ${opt:stage, self:custom.local}
config: ${file(src/config/${self:custom.deployStage}.js):default}
provider:
name: aws
runtime: nodejs6.10
region: ${self:custom.config.awsRegion}
stage: ${self:custom.deployStage}
timeout: 30
memorySize: 128
environment:
NODE_ENV: ${self:custom.deployStage}
plugins:
- serverless-plugin-typescript
- serverless-offline
package:
include:
- src/config/
- public
functions:
httpHandler:
handler: src/index.httpHandler
events:
- http: any /
- http:
path: "{proxy+}"
method: any
cors: true
resources:
Resources:
BeerDomainName:
Type: "AWS::ApiGateway::DomainName"
Properties:
CertificateArn: ${self:custom.config.acmCertArn}
DomainName: ${self:custom.config.urls.canIBuyBeer}
BeerBasePathMapping:
Type: "AWS::ApiGateway::BasePathMapping"
DependsOn:
- BeerDNSRecord
Properties:
DomainName: ${self:custom.config.urls.canIBuyBeer}
RestApiId: { Ref: ApiGatewayRestApi }
Stage: ${self:custom.deployStage}
BasePath: "(none)"
BeerDNSRecord:
Type: "AWS::Route53::RecordSet"
Properties:
HostedZoneName: canibuybeer.com.
Name: ${self:custom.config.urls.canIBuyBeer}.
Type: CNAME
TTL: "60"
ResourceRecords:
- Fn::Join: [ "", [
{ Ref: ApiGatewayRestApi },
".execute-api.${self:custom.config.awsRegion}.amazonaws.com"
]]