-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yaml
68 lines (64 loc) · 1.79 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
60
61
62
63
64
65
66
67
68
Transform: AWS::Serverless-2016-10-31
Resources:
PopplerApi:
Type: AWS::Serverless::Api
Properties:
Name: !Sub
- ${ResourceName} From Stack ${AWS::StackName}
- ResourceName: PopplerApi
StageName: Prod
DefinitionBody:
openapi: '3.0'
info: {}
paths:
/:
post:
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri: !Sub arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${PopplerFunction.Arn}/invocations
responses: {}
EndpointConfiguration: REGIONAL
TracingEnabled: true
Cors:
MaxAge: 5
PopplerFunction:
Type: AWS::Serverless::Function
Properties:
Description: !Sub
- Stack ${AWS::StackName} Function ${ResourceName}
- ResourceName: PopplerFunction
CodeUri: src/Function
Handler: index.handler
Runtime: nodejs20.x
MemorySize: 3008
Timeout: 30
Tracing: Active
Layers:
- !Ref PopplerLayer
Events:
PopplerApiPOST:
Type: Api
Properties:
Path: /
Method: POST
RestApiId: !Ref PopplerApi
Architectures:
- arm64
Environment:
Variables:
FONTCONFIG_PATH: /opt/etc/fonts
PopplerFunctionLogGroup:
Type: AWS::Logs::LogGroup
DeletionPolicy: Retain
Properties:
LogGroupName: !Sub /aws/lambda/${PopplerFunction}
PopplerLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: poppler
ContentUri: layers/poppler/release-arm64.zip
Outputs:
ApiUrl:
Description: URL of the Poppler API
Value: !Sub https://${PopplerApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/