-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
59 lines (54 loc) · 1.61 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
55
56
57
58
59
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Lambda Layer providing sharp with JP2 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
LayerName:
Default: sharp-jp2
Description: The name of the Lambda Layer that will be created.
Type: String
Conditions:
NoOrganizationId: !Equals [ !Ref OrganizationId, none ]
UseDefaultPrincipal: !Equals [ !Ref Principal, account ]
Resources:
SharpJP2Layer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: !Ref LayerName
Description: Sharp Layer with JP2 Support
ContentUri: ./layer/
CompatibleRuntimes:
- nodejs20.x
- nodejs18.x
LicenseInfo: 'Apache-2.0'
RetentionPolicy: Retain
Metadata:
BuildMethod: makefile
SharpJP2LayerPermission:
Type: AWS::Lambda::LayerVersionPermission
Properties:
Action: lambda:GetLayerVersion
LayerVersionArn: !Ref SharpJP2Layer
Principal:
Fn::If:
- UseDefaultPrincipal
- !Ref AWS::AccountId
- !Ref Principal
OrganizationId:
Fn::If:
- NoOrganizationId
- !Ref AWS::NoValue
- !Ref OrganizationId
Outputs:
SharpJP2LayerArn:
Value: !Ref SharpJP2Layer
Description: ARN of the Sharp JP2 Lambda Layer
Export:
Name: SharpJP2LayerArn