AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > lambda-springboot-sample Sample SAM Template for lambda-springboot Globals: Function: Tracing: Active CodeUri: target/function-native-zip.zip Handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest Runtime: provided Timeout: 30 MemorySize: 1024 Environment: Variables: PRODUCT_TABLE_NAME: !Ref ProductsTable Resources: MyApi: Type: AWS::Serverless::Api Properties: StageName: prod Name: My Lambda springboot GraalVM Sample API GetProductByIdFunction: Type: AWS::Serverless::Function Properties: Environment: Variables: SPRING_CLOUD_FUNCTION_DEFINITION: getProductByIdFunction Policies: - DynamoDBReadPolicy: TableName: !Ref ProductsTable Events: GetRequestById: Type: Api Properties: RestApiId: !Ref MyApi Path: /products/{id} Method: get GetProductsFunction: Type: AWS::Serverless::Function Properties: Environment: Variables: SPRING_CLOUD_FUNCTION_DEFINITION: getAllProductsFunction Policies: - DynamoDBReadPolicy: TableName: !Ref ProductsTable Events: GetRequest: Type: Api Properties: RestApiId: !Ref MyApi Path: /products Method: get PutProductFunction: Type: AWS::Serverless::Function Properties: Environment: Variables: SPRING_CLOUD_FUNCTION_DEFINITION: createProductFunction Policies: - DynamoDBCrudPolicy: TableName: !Ref ProductsTable Events: PutRequest: Type: Api Properties: RestApiId: !Ref MyApi Path: /products/{id} Method: put DeleteProductFunction: Type: AWS::Serverless::Function Properties: Environment: Variables: SPRING_CLOUD_FUNCTION_DEFINITION: deleteProductFunction Policies: - DynamoDBCrudPolicy: TableName: !Ref ProductsTable Events: PutRequest: Type: Api Properties: RestApiId: !Ref MyApi Path: /products/{id} Method: delete ProductsTable: Type: AWS::DynamoDB::Table Properties: AttributeDefinitions: - AttributeName: 'PK' AttributeType: 'S' KeySchema: - AttributeName: 'PK' KeyType: 'HASH' BillingMode: PAY_PER_REQUEST Outputs: ApiEndpoint: Description: "API Gateway endpoint URL for Prod stage for Springboot sample function" Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/prod/products"