-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtemplate.yml
47 lines (44 loc) · 1.14 KB
/
template.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
45
46
47
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: unzip uploaded zip file to another S3 bucket
Parameters:
ZippedArtifactBucket:
Type: String
UnzippedArtifactBucket:
Type: String
Resources:
Unzipper:
Type: AWS::Serverless::Function
Properties:
CodeUri: artifact
Handler: unzipper
Runtime: go1.x
Timeout: 180
Policies:
- S3CrudPolicy:
BucketName: !Ref ZippedArtifactBucket
- S3CrudPolicy:
BucketName: !Ref UnzippedArtifactBucket
Environment:
Variables:
UNZIPPED_ARTIFACT_BUCKET: !Ref UnzippedArtifactBucket
Tracing: Active
Events:
UploadedEvent:
Type: S3
Properties:
Bucket: !Ref Zipped
Events: s3:ObjectCreated:Put
UnzipperLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${Unzipper}
RetentionInDays: 1
Zipped:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref ZippedArtifactBucket
Unzipped:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref UnzippedArtifactBucket