forked from codeforjapan/remote-patient-monitoring-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
112 lines (102 loc) · 3.95 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
#
# Happy Coding!
service: remote-patient-monitoring
# app and org for use with dashboard.serverless.com
#app: your-app-name
#org: your-org-name
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
frameworkVersion: "2"
provider:
name: aws
runtime: nodejs12.x
# you can overwrite defaults here
stage: ${opt:stage, self:custom.defaultStage}
region: ap-northeast-1
apiGateway:
shouldStartNameWithService: true
# you can add statements to the Lambda function's IAM Role here
# iamRoleStatements:
# - Effect: "Allow"
# Action:
# - "s3:ListBucket"
# Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ] }
# - Effect: "Allow"
# Action:
# - "s3:PutObject"
# Resource:
# Fn::Join:
# - ""
# - - "arn:aws:s3:::"
# - "Ref" : "ServerlessDeploymentBucket"
# - "/*"
# you can define service wide environment variables here
environment:
Bucket: ${file(config/${self:provider.stage}.json):Bucket}
DebugMode: ${file(config/${self:provider.stage}.json):DebugMode}
OauthCallbackURL: ${file(config/${self:provider.stage}.json):OauthCallbackURL}
OauthSignoutURL: ${file(config/${self:provider.stage}.json):OauthSignoutURL}
AuthAdminUserPoolDomain: ${file(config/${self:provider.stage}.json):AuthAdminUserPoolDomain}
AuthNurseUserPoolDomain: ${file(config/${self:provider.stage}.json):AuthNurseUserPoolDomain}
AuthPatientUserPoolDomain: ${file(config/${self:provider.stage}.json):AuthPatientUserPoolDomain}
DBPrefix: ${file(config/${self:provider.stage}.json):DBPrefix}
SMS_ENDPOINT: ${file(config/${self:provider.stage}.json):SMS_ENDPOINT}
SMS_SECURITYKEY: ${file(config/${self:provider.stage}.json):SMS_SECURITYKEY}
SMS_ACCESSKEY: ${file(config/${self:provider.stage}.json):SMS_ACCESSKEY}
LOGINURL: ${file(config/${self:provider.stage}.json):LOGINURL}
IS_OFFLINE: ${opt:offline, ''}
custom:
defaultStage: dev
project: remote-patient-monitoring
baseName: ${self:custom.project}-${self:provider.stage}
scriptHooks:
after:aws:deploy:deploy:updateStack:
- ./.lib/src/plugins/generateConfigFile.js
- ./node_modules/.bin/webpack --mode production --progress
assets:
auto: true
targets:
- bucket: !Ref SwaggerBucket
files:
- source: dist
empty: true
globs: "**/*"
# empty the Swagger UI S3 bucket content when removing the service so the bucket can be removed
remover:
buckets:
- ${cf:${self:custom.baseName}.SwaggerBucketName, ''}
serverless-offline:
resourceRoutes: true
# you can add packaging information here
package:
# include:
# - include-me.js
# - include-me-dir/**
${file(./templates/exclude-files.yml)}
functions: ${file(./templates/functions-${self:provider.environment.IS_OFFLINE}.yml)}
# you can add CloudFormation resource templates here
resources:
# Please comment out below two lines for the first deploy. After the deployment, enable it and deploy again.
- ${file(./templates/api-auth.yml)}
- ${file(./templates/api-gateway.yml)}
- ${file(./templates/swagger-ui.yml)}
# Swagger UI 関連の設計は https://betterdev.blog/serverless-swagger-ui-for-api-gateway/ を参考にした。
plugins:
- serverless-pseudo-parameters
- serverless-s3-deploy
- serverless-scriptable-plugin
- serverless-cloudformation-sub-variables
- serverless-s3-remover
- serverless-plugin-typescript
- serverless-offline
- serverless-dynamodb-local