-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
115 lines (109 loc) · 3.14 KB
/
serverless.yml
File metadata and controls
115 lines (109 loc) · 3.14 KB
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
113
114
115
service: 'cct-server-seoul'
frameworkVersion: '3'
useDotenv: true
plugins:
- serverless-webpack
- serverless-offline
- serverless-webpack-prisma
- serverless-domain-manager
- serverless-certificate-creator
package:
patterns:
- '!node_modules/.prisma/client/libquery_engine-*'
- 'node_modules/.prisma/client/libquery_engine-rhel-*'
- '!node_modules/prisma/libquery_engine-*'
- '!node_modules/@prisma/engines/**'
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
packager: 'yarn'
excludeFiles: src/**/*.test.js
packagerOptions:
scripts:
- prisma generate
domains:
prod:
domainName: api-prod-seoul.teamhh.link
certificateName: api-prod-seoul.teamhh.link
customCertificate:
hostedZoneNames: "teamhh.link.seoul."
certificateName: ${self:custom.domains.${self:provider.stage}.certificateName}
region: ${self:provider.region}
# Route53
customDomain:
domainName: ${self:custom.domains.${self:provider.stage}.domainName}
certificateName: ${self:custom.domains.${self:provider.stage}.certificateName}
# Enable plugin to create an A Alias and AAAA Alias records in Route53
# mapping the domainName to the generated distribution domain name.
createRoute53Record: true
createRoute53IPv6Record: true
# Enable plugin to autorun create_domain/delete_domain as part of sls deploy/remove
autoDomain: true
endpointType: regional
apiType: http
provider:
name: aws
stage: prod
runtime: 'nodejs18.x'
timeout: 10
region: 'ap-northeast-2'
stackName: cct-server-seoul-stack
deploymentBucket:
name: cct-server-seoul-bucket
apiGateway:
minimumCompressionSize: 1024
shouldStartNameWithService: true
environment:
DOMAIN: ${self:custom.customDomain.domainName}
STAGE: ${self:provider.stage}
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'
KAKAO_REST_API_KEY: ${env:KAKAO_REST_API_KEY}
DATABASE_URL: ${env:DATABASE_URL}
CLIENT_URI_DEV: ${env:CLIENT_URI_DEV}
CLIENT_URI_PROD: ${env:CLIENT_URI_PROD}
SERVER_URI_DEV: ${env:SERVER_URI_DEV}
SERVER_URI_PROD: ${env:SERVER_URI_PROD}
APP_ACCESS_SECRET: ${env:APP_ACCESS_SECRET}
APP_REFRESH_SECRET: ${env:APP_REFRESH_SECRET}
iam:
role:
statements:
- Effect: 'Allow'
Action:
- 's3:getObject'
Resource: 'arn:aws:s3:::cct-server-seoul-bucket'
- Effect: 'Allow'
Action:
- 'sts:AssumeRole'
Resource: 'arn:aws:sts:::assumed-role/*'
httpApi:
cors:
allowedOrigins:
- 'http://localhost:5173'
- 'https://localhost:5173'
- 'https://hyodee-card.surge.sh'
- 'https://card.teamhh.link'
allowedMethods:
- GET
- OPTIONS
- POST
- PUT
- DELETE
allowedHeaders:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
- X-Transaction-Key
- Range
- baggage
- sentry-trace
allowCredentials: true
functions:
api:
handler: src/handler.handler
events:
- httpApi: '*'