forked from zoellner/sharp-heic-lambda-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
54 lines (49 loc) · 1.47 KB
/
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
Description: Lambda Layer providing sharp with HEIC support
Parameters:
OrganizationId:
Default: none
Description: With the principal set to *, grant permission to all accounts in the specified organization.
Type: String
Principal:
Default: account
Description: An account ID, or * to grant permission to use the layer to all AWS accounts.
Type: String
Conditions:
NoOrganizationId: !Equals [ !Ref OrganizationId, none ]
UseDefaultPrincipal: !Equals [ !Ref Principal, account ]
Resources:
SharpHEICLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: sharp-heic
Description: Sharp Layer with HEIC Support
ContentUri: ./layer/
CompatibleRuntimes:
- nodejs14.x
LicenseInfo: 'MIT'
RetentionPolicy: Retain
Metadata:
BuildMethod: makefile
SharpHEICLayerPermission:
Type: AWS::Lambda::LayerVersionPermission
Properties:
Action: lambda:GetLayerVersion
LayerVersionArn: !Ref SharpHEICLayer
Principal:
Fn::If:
- UseDefaultPrincipal
- !Ref AWS::AccountId
- !Ref Principal
OrganizationId:
Fn::If:
- NoOrganizationId
- !Ref AWS::NoValue
- !Ref OrganizationId
Outputs:
SharpHEICLayerArn:
Value: !Ref SharpHEICLayer
Description: ARN of the Sharp HEIC Lambda Layer
Export:
Name: SharpHEICLayerArn