Add SAM to sample

This commit is contained in:
Oleg Zhurakousky
2024-05-07 16:43:08 +02:00
parent 1787df8bb6
commit 48cc409206
4 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
routeKey
rawQueryString
path
resource

View File

@@ -0,0 +1,41 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Example function as lambda deployment
Globals:
Api:
# API Gateway regional endpoints
EndpointConfiguration: REGIONAL
Resources:
PetStoreMVC:
Type: AWS::Serverless::Function
Properties:
# AutoPublishAlias: bcn
FunctionName: uppercase
Handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
Runtime: java17
SnapStart:
ApplyOn: PublishedVersions
CodeUri: .
MemorySize: 1024
Policies: AWSLambdaBasicExecutionRole
Timeout: 30
Environment:
Variables:
MAIN_CLASS: example.FunctionConfiguration
Events:
HttpApiEvent:
Type: HttpApi
Properties:
TimeoutInMillis: 20000
PayloadFormatVersion: '1.0'
Outputs:
PetStoreMVCApi:
Description: URL for application
Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/uppercase'
Export:
Name: UppercaseAPI