-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
102 lines (96 loc) · 2.54 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
service: tejas-service
org: tensorclan
frameworkVersion: '2'
provider:
name: aws
runtime: python3.8
stage: dev
region: ap-south-1
timeout: 60
environment:
PRODUCTION: TRUE
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:DescribeTable
Resource: "*"
- Effect: Allow
Action:
- s3:GetObject
- s3:PutObject
- s3:ListBucket
Resource: "*"
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: "*"
apiGateway:
shouldStartNameWithService: true
binaryMediaTypes:
- "multipart/form-data"
- "*/*"
functions:
tejas:
handler: tejas.handler
memorySize: 704
events:
- http:
method: ANY
path: /
- http:
method: ANY
path: /{proxy+}
# websockets not supported by Mangum for now
# - websocket:
# route: $connect
# - websocket:
# route: $disconnect
# - websocket:
# route: $default
fileSystemConfig:
localMountPath: /mnt/tejas-fs
arn: arn:aws:elasticfilesystem:ap-south-1:668527606260:access-point/fsap-0ed6c22fc0aa6a295
vpc:
securityGroupIds:
- sg-07c194e6b1aa88b25
subnetIds:
- subnet-64b8f40c
- subnet-0db20f41
- subnet-2a3fcf51
environment:
TASKS_TABLE: ${self:custom.tasksTableName}
TEJAS_LAMBDA: true
TEJAS_LIBS_PATH: /mnt/tejas-fs/tejas-libs
TEJAS_MODELS_PATH: /mnt/tejas-fs/tejas-models
TEJAS_MODELS_BUCKET: ${self:custom.tejasModelsBucket}
TEJAS_DATASETS_BUCKET: ${self:custom.tejasDatasetsBucket}
TEJAS_DATASETS_PATH: /mnt/tejas-fs/tejas-datasets
TEJAS_MODEL_TRAIN_LAMBDA_ARN: arn:aws:lambda:ap-south-1:668527606260:function:tejas-ml-service-dev-train_model
custom:
tasksTableName: tejastasks
tejasModelsBucket: ${self:service}-${self:provider.stage}-models
# the datasets buckets is tied with tejas-ml-service make sure to use the same name
tejasDatasetsBucket: tejas-service-datasets
resources:
Resources:
tejasModelsS3:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.tejasModelsBucket}
CorsConfiguration:
CorsRules:
- AllowedMethods:
- GET
- HEAD
AllowedOrigins:
- "*"
package:
exclude:
- requirements/
- requirements/**