-
Notifications
You must be signed in to change notification settings - Fork 14
/
output.yaml
62 lines (62 loc) · 1.64 KB
/
output.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
AWSTemplateFormatVersion: 2010-09-09
Description: A serverless component for CSV to XLSX conversion
Outputs:
InputS3Bucket:
Description: Input S3 bucket
Value:
Ref: InputS3Bucket
OutputS3Bucket:
Description: Output S3 bucket
Value:
Ref: OutputS3Bucket
Parameters:
ConversionTimeout:
Default: 60
Type: Number
InputBucketName:
Default: csv-inputs-s3-bucket
Type: String
OutputBucketName:
Default: xlsx-outputs-s3-bucket
Type: String
Resources:
ConvertFileFunction:
Properties:
CodeUri: s3://sar-components-bucket/6fdbd3d12ccd0da0bfbf9116597bf386
Environment:
Variables:
EXTENSION: .xlsx
MIME_TYPE: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
RESULTS_BUCKET_NAME:
Ref: OutputS3Bucket
Events:
FileUpload:
Properties:
Bucket:
Ref: InputS3Bucket
Events: s3:ObjectCreated:*
Type: S3
Handler: index.handler
MemorySize: 512
Policies:
- S3ReadPolicy:
BucketName:
Fn::Sub: ${InputBucketName}-${AWS::StackName}
- S3CrudPolicy:
BucketName:
Fn::Sub: ${OutputBucketName}-${AWS::StackName}
Runtime: nodejs8.10
Timeout:
Ref: ConversionTimeout
Type: AWS::Serverless::Function
InputS3Bucket:
Properties:
BucketName:
Fn::Sub: ${InputBucketName}-${AWS::StackName}
Type: AWS::S3::Bucket
OutputS3Bucket:
Properties:
BucketName:
Fn::Sub: ${OutputBucketName}-${AWS::StackName}
Type: AWS::S3::Bucket
Transform: AWS::Serverless-2016-10-31