-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yml
More file actions
53 lines (48 loc) · 1.46 KB
/
template.yml
File metadata and controls
53 lines (48 loc) · 1.46 KB
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: tech.aaregall.lab:aws-lambda-spring-cloud-function
Parameters:
OpenAiApiKey:
Type: String
Description: OpenAI API key
Globals:
Api:
EndpointConfiguration: REGIONAL # API Gateway regional endpoints
Function:
Timeout: 20
MemorySize: 1512
Runtime: provided.al2
Architectures:
- arm64
Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
Resources:
# Lambda Function
SpringCloudFunctionLambda:
Type: AWS::Serverless::Function
Properties:
Handler: none # Native runtime does not need a handler
CodeUri: .
Policies: AWSLambdaBasicExecutionRole
Environment:
Variables:
OPENAI_API_KEY: !Ref OpenAiApiKey
Events:
HttpApiEvent:
Type: HttpApi
Properties:
TimeoutInMillis: 20000
PayloadFormatVersion: '1.0'
Metadata:
BuildMethod: makefile # Instruct SAM how to build application.
# Lambda LogGroup
SpringCloudFunctionLambdaLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Join [ '/', [ '/aws/lambda', !Ref SpringCloudFunctionLambda ] ]
RetentionInDays: 30
Outputs:
SpringCloudFunctionLambda:
Description: AWS Lambda Spring Cloud Function
Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com'
Export:
Name: SpringCloudFunctionLambda