-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathserverless.yaml
68 lines (62 loc) · 1.84 KB
/
serverless.yaml
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
service: "sls-ts-esm"
configValidationMode: "error"
deprecationNotificationMode: "error"
frameworkVersion: "3"
useDotenv: true
plugins:
- serverless-esbuild
- serverless-iam-roles-per-function
custom:
config: ${file(./config/env.yaml):config}
esbuild: ${file(./config/esbuild.yaml)}
provider:
name: ${self:custom.config.provider.name}
stage: ${self:custom.config.provider.stage}
region: ${self:custom.config.provider.region}
tags: ${self:custom.config.tags}
stackTags: ${self:custom.config.tags}
deploymentMethod: direct
disableRollback: ${self:custom.config.provider.disableRollback}
versionFunctions: ${self:custom.config.provider.versionFunctions}
##### AWS API Gateway configurations
endpointType: REGIONAL
apiGateway:
minimumCompressionSize: 1024
shouldStartNameWithService: true
##### Configurations shared by all AWS Lambda functions
runtime: "nodejs16.x"
memorySize: 1024
timeout: 30
architecture: arm64
logRetentionInDays: 1
##### Environment variables shared by all AWS Lambda functions
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1"
NODE_OPTIONS: ${self:custom.config.environment.NODE_OPTIONS}
functions:
me:
handler: app/functions/me.handler
environment:
SSM_CONFIG_CLIENT:
Ref: SSMConfigClient
iamRoleStatements:
- Effect: "Allow"
Action:
- ssm:GetParameter
Resource:
Fn::Sub:
[
"arn:aws:ssm:${region}:${awsAccoutId}:parameter${paramName}",
{
paramName: !Ref SSMConfigClient,
region: "${self:custom.config.provider.region}",
awsAccoutId: "${self:custom.config.awsAccoutId}",
},
]
events:
- http:
path: me
method: get
cors: true
resources:
- ${file(./app/resources/ssm.yaml)}