AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > lambda-springboot-sample Sample SAM Template for lambda-springboot Globals: Function: Architectures: - arm64 Tracing: Active CodeUri: target/function-native-zip.zip Handler: org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler Runtime: provided.al2 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: DEFAULT_HANDLER: getProductById 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: DEFAULT_HANDLER: getAllProducts 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: DEFAULT_HANDLER: createProduct 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: DEFAULT_HANDLER: deleteProduct 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"