Repository navigation
Expand file tree
/
Copy pathserverless.yml
More file actions
61 lines (56 loc) · 1.36 KB
/
Copy pathserverless.yml
File metadata and controls
61 lines (56 loc) · 1.36 KB
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
service: aws-node-singned-uploads
plugins:
- serverless-webpack
- serverless-offline #serverless-offline needs to be last in the list
custom:
bucketName: testbucket123notaken
webpack:
webpackConfig: 'webpack.config.js'
includeModules: true
packager: 'yarn'
serverless-offline:
port: 4000
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, env:AWS_STAGE, 'dev'}
region: ${opt:region, env:AWS_REGION, 'eu-central-1'}
environment:
REGION: ${self:provider.region}
BUCKET: { Ref: Uploads }
versionFunctions: false
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource: "*"
functions:
upsert-objects:
handler: src/upload.handler
name: ${self:provider.stage}-${self:service}-upload
memorySize: 128
events:
- http:
path: upload
method: get
cors: true
resources:
Resources:
Uploads:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucketName}
CorsConfiguration:
CorsRules:
- AllowedHeaders:
- "Authorization"
AllowedMethods:
- GET
AllowedOrigins:
- "*"
- AllowedHeaders:
- "*"
AllowedMethods:
- PUT
AllowedOrigins:
- "*"