-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathserverless.yml
More file actions
41 lines (38 loc) · 919 Bytes
/
serverless.yml
File metadata and controls
41 lines (38 loc) · 919 Bytes
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
service: imageUploadDemo
provider:
name: aws
runtime: nodejs4.3
# Provide permissions for this service to manipulate S3.
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource: "arn:aws:s3:::[bucketName]/*"
# Expose function to public API for POST requests.
functions:
requestUploadURL:
handler: handler.requestUploadURL
events:
- http:
path: requestUploadURL
method: post
cors: true
# Give service access to the specific S3 bucket.
resources:
Resources:
UploadBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: [bucketName]
AccessControl: PublicRead
CorsConfiguration:
CorsRules:
- AllowedMethods:
- GET
- PUT
- POST
- HEAD
AllowedOrigins:
- "*"
AllowedHeaders:
- "*"