forked from sutt0n/serverless-clamav-lambda-layer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
66 lines (58 loc) · 1.2 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
service: clambda-av
plugins:
- serverless-plugin-warmup
- serverless-prune-plugin
useDotenv: true
custom:
warmup:
warmer:
enabled: true
prune:
automatic: true
number: 3
resources:
Resources:
Definitions:
Type: AWS::S3::Bucket
Properties:
BucketName: ${env:DEFINITIONS_BUCKET}
provider:
name: aws
runtime: nodejs14.x
region: eu-central-1
environment:
DEFINITIONS_BUCKET: ${env:DEFINITIONS_BUCKET}
ecr:
images:
clambda-av:
path: ./
iamRoleStatements:
- Effect: Allow
Action:
- s3:GetObject
- s3:PutObjectTagging
Resource: "arn:aws:s3:::${env:TARGET_BUCKET}/*"
- Effect: Allow
Action:
- s3:GetObject
- s3:GetObjectAcl
- s3:PutObject
- s3:PutObjectAcl
Resource: "arn:aws:s3:::${env:DEFINITIONS_BUCKET}/*"
functions:
virusScan:
image:
name: clambda-av
memorySize: 4096
events:
- s3:
bucket: ${env:TARGET_BUCKET}
event: s3:ObjectCreated:*
- schedule:
rate: rate(3 hours)
name: update-virus-definitions-schedule
timeout: 120
package:
exclude:
- node_modules/**
- coverage/**