Move CLI samples to sample repo
This commit is contained in:
33
spring-cloud-function-samples/scf-aws-sam/.gitignore
vendored
Normal file
33
spring-cloud-function-samples/scf-aws-sam/.gitignore
vendored
Normal 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/
|
||||
1
spring-cloud-function-samples/scf-aws-sam/README.md
Normal file
1
spring-cloud-function-samples/scf-aws-sam/README.md
Normal file
@@ -0,0 +1 @@
|
||||
TBD
|
||||
41
spring-cloud-function-samples/scf-aws-sam/template.yml
Normal file
41
spring-cloud-function-samples/scf-aws-sam/template.yml
Normal 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"
|
||||
Reference in New Issue
Block a user