schema:
  format:
    openapi: "3.0.0"
  service_input_type: "CrudServiceInput"
  pipeline_input_type: "PipelineInputs"

  types:
    CrudServiceInput:
      type: object
      description: "Input properties for a Lambda backed CRUD API. When given a resource name, this input will be used to generate Create, Read, Update and Delete API methods and lambdas."
      properties:
        resource_name:
          title: "Resource name"
          type: string
          description: "The resource to generate a CRUD API for"
          minLength: 1
          maxLength: 50
          default: "task"
        resource_handler:
          title: "Resource handler"
          type: string
          description: "The handler path to find the CRUD methods for this API"
          minLength: 1
          maxLength: 50
          default: "src/api"
        lambda_memory:
          title: "Lambda memory"
          type: number
          description: "The size of your Lambda functions in MB"
          default: 512
          minimum: 1
          maximum: 3008
        lambda_timeout:
          title: "Lambda timeout"
          type: number
          description: "The timeout in seconds of your Lambda function"
          default: 30
          minimum: 1
          maximum: 900
        lambda_runtime:
          title: "Lambda runtime"
          type: string
          description: "The runtime for your Lambda service"
          enum: ["nodejs12.x", "python3.8", "ruby2.7", "java11", "go1.x", "dotnetcore3.1"]
          default: "ruby2.7"
        code_uri:
          title: "Code URI"
          type: string
          description: "The s3 link to your application"
          minLength: 1
          maxLength: 200

    PipelineInputs:
      type: object
      description: "Pipeline input properties"
      properties:
        unit_test_command:
          title: "Unit test command"
          type: string
          description: "The command to run to unit test the application code"
          default: "echo 'add your unit test command here'"
          minLength: 1
          maxLength: 200
        packaging_command:
          title: "Packaging command"
          type: string
          description: "The commands which packages your code into a file called function.zip"
          default: "make publish"
          minLength: 1
          maxLength: 200