-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.ts
60 lines (58 loc) · 1.32 KB
/
serverless.ts
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
import { AWS } from '@serverless/typescript';
const configuration: AWS = {
service: 'datadog',
useDotenv: true,
provider: {
name: 'aws',
runtime: 'nodejs18.x',
timeout: 30,
stage: 'test',
},
package: { individually: true },
functions: {
authorizer: {
handler: 'dist/authorizer.handler',
architecture: 'arm64',
environment: {
SHOULD_AUTHORIZE_REQUEST: '${env:SHOULD_AUTHORIZE_REQUEST}'
},
package: {
patterns: ['!./**', 'dist/authorizer.js']
}
},
getUsers: {
handler: 'dist/get-user.handler',
architecture: 'arm64',
events: [
{
http: {
method: 'get',
path: '/',
authorizer: {
name: 'authorizer',
resultTtlInSeconds: 0,
type: 'request',
},
cors: true,
},
},
],
package: {
patterns: ['!./**', 'dist/get-user.js']
}
},
},
plugins: ['serverless-plugin-datadog', 'serverless-offline', 'serverless-plugin-lambda-insights'],
custom: {
datadog: {
enableXrayTracing: true,
addLayers: true,
apiKey: '${env:DATADOG_API_KEY}',
env: 'test',
},
lambdaInsights: {
defaultLambdaInsights: true,
},
}
}
module.exports = configuration;