AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An AWS Serverless Specification template describing your function.
Resources:
  format:
    Type: 'AWS::Serverless::Function'
    Properties:
      CodeUri: build/distributions/lambda.zip
      Handler: 'com.facebook.ktfmt.onlineformatter.Handler::handleRequest'
      Runtime: java11
      Description: ''
      MemorySize: 1024
      Timeout: 15
      Policies:
        - AWSLambdaBasicExecutionRole
        - AWSLambda_ReadOnlyAccess
        - AWSXrayWriteOnlyAccess
        - AWSLambdaVPCAccessExecutionRole
      Tracing: Active
      Layers:
        - !Ref libs
  libs:
    Type: AWS::Serverless::LayerVersion
    Properties:
      LayerName: ktfmt-lib
      Description: Dependencies for ktfmt
      ContentUri: build/lambda-lib.zip
      CompatibleRuntimes:
        - java11
