forked from jbesw/sar-s3-serverless-uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackaged.yaml
69 lines (68 loc) · 1.55 KB
/
packaged.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 'Serverless S3 Uploader - upload files to S3 buckets from your web applications
using pre-signed URLs.
'
Globals:
Api:
EndpointConfiguration: EDGE
Cors:
AllowMethods: '''OPTIONS,GET'''
AllowHeaders: '''Content-Type'''
AllowOrigin: '''*'''
Function:
Timeout: 5
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
CorsConfiguration:
CorsRules:
- AllowedHeaders:
- '*'
AllowedMethods:
- GET
- PUT
- POST
- DELETE
- HEAD
AllowedOrigins:
- '*'
S3UploaderFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://jbesw-sar-deployments-useast1/56f0700182d83bdf31c2ce2d76534789
Handler: app.handler
Runtime: nodejs12.x
MemorySize: 128
Environment:
Variables:
UploadBucket:
Ref: S3Bucket
Policies:
- S3CrudPolicy:
BucketName:
Ref: S3Bucket
Events:
HttpPost:
Type: Api
Properties:
Path: /
Method: get
Outputs:
S3UploaderFunction:
Description: Lambda Function ARN
Value:
Fn::GetAtt:
- S3UploaderFunction
- Arn
S3UploaderFunctionIamRole:
Description: Implicit IAM Role created for function
Value:
Fn::GetAtt:
- S3UploaderFunctionRole
- Arn
S3BucketName:
Description: S3 bucket
Value:
Ref: S3Bucket