forked from vibrato/s3-to-gcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
53 lines (48 loc) · 1.23 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
service: s3-to-gcs
custom:
pythonRequirements:
dockerizePip: non-linux
provider:
name: aws
runtime: python3.6
region: eu-central-1
# you can add statements to the Lambda function's IAM Role here
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ] }
- Effect: "Allow"
Action:
- "s3:PutObject"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- "Ref" : "ServerlessDeploymentBucket"
- "/*"
- Effect: "Allow"
Action:
- "s3:GetObject"
Resource: "arn:aws:s3:::${opt:aws_bucket}/*"
- Effect: "Allow"
Action:
- "s3:PutBucketNotification"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::${opt:aws_bucket}"
functions:
s3_to_gcs:
handler: handler.lambda_handler
events:
- existingS3:
bucket: ${opt:aws_bucket}
events:
- s3:ObjectCreated:*
environment:
GOOGLE_APPLICATION_CREDENTIALS: service-account.json
GCS_BUCKET_NAME: ${opt:gcs_bucket}
plugins:
- serverless-python-requirements
- serverless-plugin-existing-s3