forked from danielstaleiny/serverless-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
79 lines (74 loc) · 1.75 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
service: ${file(config.json):name}
plugins:
- serverless-webpack
- serverless-offline
custom:
webpack:
includeModules:
forceExclude:
- aws-sdk
- serverless
packager: "yarn"
package:
include:
- src/**
- node_modules/**
exclude:
- .git/**
- .env
- docker-compose.yml
- Dockerfile
- LICENSE
- README.md
- package.json
- package-lock.json
- tests/**
- yarn.lock
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:STAGE}
region: eu-central-1
environment: # Service wide environment variables
STAGE: ${opt:STAGE}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
- "s3:GetObject"
- "s3:GetObjectAcl"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- ${file(config.json):${opt:STAGE}.sourceBucket}
- "/"
- ${file(config.json):${opt:STAGE}.sourcePrefix}
- "*"
- Effect: "Allow"
Action:
- "s3:ListBucket"
- "s3:PutObject"
- "s3:DeleteObject"
- "s3:GetObjectAcl"
- "s3:ListBucketMultipartUploads"
- "s3:ListMultipartUploadParts"
- "s3:PutObject"
- "s3:PutObjectAcl"
- "s3:PutObjectTagging"
- "s3:PutObjectVersionAcl"
- "s3:PutObjectVersionTagging"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- ${file(config.json):${opt:STAGE}.destinationBucket}
- "/"
- ${file(config.json):${opt:STAGE}.destinationPrefix}
- "*"
functions:
resizeImage:
description: Resizes images
memorySize: 1024
timeout: 30
handler: handler.processImage