Move CLI samples to sample repo

This commit is contained in:
Oleg Zhurakousky
2023-10-25 16:28:31 +02:00
parent f485eba254
commit fe7aae0590
25 changed files with 1564 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

View File

@@ -0,0 +1 @@
TBD

View File

@@ -0,0 +1,41 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Example of deploying Java function as AWS Lambda Function with AWS API Gateway using Spring Cloud Function support.
Globals:
Api:
# API Gateway regional endpoints
EndpointConfiguration: REGIONAL
Resources:
UppercaseFunction:
Type: AWS::Serverless::Function
Properties:
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: io.spring.sample.FunctionConfiguration
Events:
HttpApiEvent:
Type: HttpApi
Properties:
TimeoutInMillis: 20000
PayloadFormatVersion: '1.0'
Outputs:
SpringUppercaseApi:
Description: URL for application
Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/uppercase'
Export:
Name: UppercaseFunction
# curl -H "Content-Type: application/json" -X POST -d '"foobar"' https://jvd5wf478j.execute-api.us-east-2.amazonaws.com/uppercase
# you should receive the response "FOOBAR"