-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
44 lines (41 loc) · 1.14 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
service: change-longlinks
provider:
name: aws
runtime: nodejs18.x
endpointType: ${file(config.json):api_endpoint_type}
stage: ${file(config.json):stage}
region: ${file(config.json):region}
iamRoleStatements:
- Effect: Allow
Action:
- s3:PutObject
Resource: "arn:${file(config.json):s3_partition}:s3:::${file(config.json):bucket}/*"
functions:
store:
handler: api/store.handle
events:
- http:
path: /
method: post
cors: true
resources:
Resources:
ServerlesslyRedirectS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${file(config.json):bucket}
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
ServerlesslyRedirectS3BucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: ${file(config.json):bucket}
PolicyDocument:
Statement:
- Action:
- s3:GetObject
Effect: Allow
Resource:
- arn:${file(config.json):s3_partition}:s3:::${file(config.json):bucket}/*
Principal: "*"