This repository has been archived by the owner on Jul 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
68 lines (67 loc) · 1.51 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
service: bazel-s3-cache
provider:
name: aws
runtime: python3.6
memorySize: 128
stage: ${opt:stage, 'dev'}
stackTags:
'mup:owner': 'core-services'
'mup:productName': '${self:service}'
tracing: true
iamRoleStatements:
- Effect: Allow
Action:
- 'xray:PutTraceSegments'
- 'xray:PutTelemetryRecords'
Resource:
- '*'
- Effect: Allow
Action:
- "s3:*"
Resource: { "Fn::Join": ["", ["arn:aws:s3:::", { "Ref": "Cache" }, "/*" ] ] }
environment:
BUCKET: '${self:custom.bucket}'
USERNAME: '${env:USERNAME}'
PASSWORD: '${env:PASSWORD}'
plugins:
- serverless-plugin-tracing
- serverless-rust
custom:
bucket: bazel-cache-${self:provider.stage}
rust:
cargoFlags: '--features lando/python3-sys'
package:
individually: true
exclude:
- ./**
functions:
cache:
handler: liblambda.handler
package:
include:
- liblambda.so
events:
- http:
path: '/{any+}'
method: get
- http:
path: '/{any+}'
method: head
- http:
path: '/{any+}'
method: put
resources:
Resources:
Cache:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucket}
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
LifecycleConfiguration:
Rules:
- Id: CacheTillage
Status: Enabled
ExpirationInDays: 30