-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathlambda_template.yaml.j2
39 lines (38 loc) · 1.08 KB
/
lambda_template.yaml.j2
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: >-
Lambda-based translation-server to run Zotero translators ({{ node_env }})
Resources:
# Lambda function
Lambda:
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: {{ main_function_name }}
CodeUri: ./
Handler: src/lambda.handler
Runtime: nodejs14.x
MemorySize: 2048
Timeout: 30
Policies:
- LambdaInvokePolicy:
FunctionName: {{ identifier_search_function_name }}
Events:
# API Gateway
PostAPI:
Type: Api
Properties:
# Proxy all POST requests to Lambda function
Path: /{proxy+}
Method: post
OptionsAPI:
Type: Api
Properties:
# Proxy all OPTIONS requests to Lambda function
Path: /{proxy+}
Method: options
Environment:
Variables:
NODE_ENV: {{ node_env }}
Outputs:
API:
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"