-
Notifications
You must be signed in to change notification settings - Fork 3
/
aws.template.yaml
54 lines (54 loc) · 1.46 KB
/
aws.template.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
---
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Parameters:
ExiftoolBucketName:
Type: String
Default: test-bucket
Resources:
ExiftoolLambda:
Type: AWS::Serverless::Function
Properties:
Handler: exiftool.app.handler
Runtime: python3.9
Timeout: 300
MemorySize: 256
CodeUri: ./app
Layers:
- !Ref ExiftoolLayerVersion
Environment:
Variables:
EXIFTOOL_BIN: /opt/bin/exiftool
Policies:
- Statement:
- Sid: S3PolicyGetObject
Effect: Allow
Action:
- s3:GetObject
Resource: !Sub arn:aws:s3:::${ExiftoolBucketName}/*
- Sid: S3PolicyListbucket
Effect: Allow
Action:
- s3:ListBucket
Resource: !Sub arn:aws:s3:::${ExiftoolBucketName}/
Events:
s3ObjectCreated:
Type: S3
Properties:
Bucket: !Ref ExiftoolBucket
Events: s3:ObjectCreated:*
ExiftoolLayerVersion:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: exiftool
ContentUri: layer/exiftool.zip
ExiftoolBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref ExiftoolBucketName
AccessControl: Private
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true