-
Notifications
You must be signed in to change notification settings - Fork 3
/
serverless.yml
45 lines (39 loc) · 1002 Bytes
/
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
service:
name: decoder
plugins:
- serverless-plugin-typescript
custom:
stage: ${opt:stage, "dev"}
prefix: decoder-${self:custom.stage}
bucketName: ${self:custom.prefix}-abis
provider:
name: aws
runtime: nodejs8.10
environment:
BUCKET_NAME: ${self:custom.bucketName}
LOG_LEVEL: ${opt:logLevel, "debug"}
ETHERSCAN_API_KEY: ${opt:etherscanApiKey, "TestApiKey"}
ETHERSCAN_API_URL: ${opt:etherscanApiUrl, "https://api.etherscan.io/api"}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource: "arn:aws:s3:::${self:custom.bucketName}"
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:PutObject"
Resource: "arn:aws:s3:::${self:custom.bucketName}/*"
functions:
decode-logs:
handler: src/decode-logs.handle
events:
- http:
method: post
path: /decode-logs
resources:
Resources:
AbiBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucketName}