-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
109 lines (97 loc) · 2.84 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
service: aws-node
frameworkVersion: "4.4.11"
plugins:
- serverless-offline
- serverless-prune-plugin
- serverless-webpack
- serverless-appsync-plugin
build:
esbuild: false
package:
individually: true
patterns:
- "!./**"
provider:
name: aws
runtime: nodejs20.x
architecture: arm64
region: ${opt:region, 'ap-south-1'}
stage: ${sls:stage, 'dev'}
stackName: ${self:service}-stack-${self:provider.stage}
timeout: 45
memorySize: 640
tracing:
apiGateway: true
lambda: true
custom:
base: ${self:service}-${self:provider.stage}
defaults: ${file(./config/defaults.yml):${self:provider.stage}}
prune:
automatic: true
number: 1
webpack:
webpackConfig: webpack.config.js
# Dynamodb table names
dynamodb:
todosTable: ${self:custom.base}-Todos
# Layers
layers:
base: layer-${self:custom.base}
utils: ${self:custom.layers.base}-Utils
# Mapping of Lambda ARN
lambda:
# Base ARN
base:
arn: arn:aws:lambda:${self:provider.region}:${aws:accountId}:function
# Lambda Functions ARN here
auth:
name: ${self:custom.base}-auth
arn: ${self:custom.lambda.base.arn}:${self:custom.lambda.auth.name}
exception:
name: ${self:custom.base}-exception
arn: ${self:custom.lambda.base.arn}:${self:custom.lambda.exception.name}
appSync:
name: ${self:custom.base}-appsync
authentication:
type: AWS_IAM
additionalAuthentications: ${file(./config/appsync/additionalAuthentications.yml):${self:provider.stage}}
apiKeys:
- name: ${self:custom.base}-appsync-api-key
logging:
enabled: true
level: ${self:custom.defaults.APPSYNC.LOG_LEVEL}
cloudWatchLogsRoleArn: !GetAtt [AppSyncRole, Arn]
xrayEnabled: false
dataSources: ${file(./config/appsync/dataSources.yml):dataSources}
pipelineFunctions: ${file(./config/appsync/pipelineFunctions.yml):pipelineFunctions}
resolvers: ${file(./config/appsync/resolvers.yml)}
environment:
ALLOW_MOCK_DATA: "true"
functions:
auth:
name: ${self:custom.lambda.auth.name}
description: "Lambda function for Authentication"
handler: src/lambdas/auth/index.handler
environment:
ENV: ${self:provider.stage}
LOG_LEVEL: ${self:custom.defaults.LAMBDA.LOG_LEVEL}
LOG_FORMAT: ${self:custom.defaults.LAMBDA.LOG_FORMAT}
package:
patterns:
- src/auth/**
- src/utils/**
exception:
name: ${self:custom.lambda.exception.name}
description: "Lambda function for Exception Handling"
handler: src/lambdas/exception/index.handler
environment:
ENV: ${self:provider.stage}
LOG_LEVEL: ${self:custom.defaults.LAMBDA.LOG_LEVEL}
LOG_FORMAT: ${self:custom.defaults.LAMBDA.LOG_FORMAT}
package:
patterns:
- src/exception/**
- src/utils/**
resources:
- ${file(./config/role.yml):resources}
- ${file(./config/dynamodb.yml):resources}