Skip to content

Instantly share code, notes, and snippets.

@ystoneman
Created August 4, 2019 06:07
Show Gist options
  • Save ystoneman/57a4fb80411a2678b58fc34ba46843f5 to your computer and use it in GitHub Desktop.
Save ystoneman/57a4fb80411a2678b58fc34ba46843f5 to your computer and use it in GitHub Desktop.
SAM.yaml by awslabs for a Spring Boot API
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Example Pet Store API written with SpringBoot with the aws-serverless-java-container library
Globals:
Api:
# API Gateway regional endpoints
EndpointConfiguration: REGIONAL
Resources:
PetStoreFunction:
Type: AWS::Serverless::Function
Properties:
Handler: com.amazonaws.serverless.sample.springboot.StreamLambdaHandler::handleRequest
Runtime: java8
CodeUri: target/serverless-spring-boot-example-1.0-SNAPSHOT-lambda-package.zip
MemorySize: 1512
Policies: AWSLambdaBasicExecutionRole
Timeout: 60
Events:
GetResource:
Type: Api
Properties:
Path: /{proxy+}
Method: any
Outputs:
SpringBootPetStoreApi:
Description: URL for application
Value: !Sub 'https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/pets'
Export:
Name: SpringBootPetStoreApi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment