samvera/serverless-iiif

View on GitHub
sam/standalone/template.yml

Summary

Maintainability
Test Coverage
Transform: "AWS::Serverless-2016-10-31"
Metadata:
  AWS::ServerlessRepo::Application:
    Name: serverless-iiif-standalone
    Description: (Deprecated) Passthrough template to install serverless-iiif
    Author: Samvera
    SpdxLicenseId: Apache-2.0
    LicenseUrl: ../../LICENSE.txt
    ReadmeUrl: ./README.md
    Labels: ["iiif", "image-processing"]
    HomePageUrl: https://samvera.github.io/serverless-iiif
    SemanticVersion: 5.0.6
    SourceCodeUrl: https://github.com/samvera/serverless-iiif
  AWS::CloudFormation::Interface:
    ParameterGroups:
      - Label:
          default: "General Configuration"
        Parameters:
          - SourceBucket
          - IiifLambdaMemory
          - IiifLambdaTimeout
          - PixelDensity
          - PyramidLimit
          - ResolverTemplate
      - Label:
          default: "CORS Configuration"
        Parameters:
          - CorsAllowCredentials
          - CorsAllowHeaders
          - CorsAllowOrigin
          - CorsExposeHeaders
          - CorsMaxAge
      - Label:
          default: "Advanced Options"
        Parameters:
          - ForceHost
          - Preflight
Parameters:
  CorsAllowCredentials:
    Type: String
    Description: >
      Value of the CORS `Access-Control-Allow-Credentials` response header.
      Must be `true` to allow requests with `Authorization` and/or
      `Cookie` headers.
    AllowedValues:
      - false
      - true
    Default: false
  CorsAllowHeaders:
    Type: String
    Description: Value of the CORS `Access-Control-Allow-Headers` response header
    Default: "*"
  CorsAllowOrigin:
    Type: String
    Description: >
      Value of the CORS `Access-Control-Allow-Origin` response header.
      Use the special value `REFLECT_ORIGIN` to copy the value from the
      `Origin` request header (required to emulate `*` for XHR requests
      using `Authorization` and/or `Cookie` headers).
    Default: "*"
  CorsExposeHeaders:
    Type: String
    Description: Value of the CORS `Access-Control-Expose-Headers` response header
    Default: cache-control,content-language,content-length,content-type,date,expires,last-modified,pragma
  CorsMaxAge:
    Type: Number
    Description: Value of the CORS `Access-Control-MaxAge` response header
    Default: 3600
  ForceHost:
    Type: String
    Description: Forced hostname to use in responses
    Default: ""
  IiifLambdaMemory:
    Type: Number
    Description: The memory provisioned for the lambda.
    MinValue: 128
    MaxValue: 10240
    Default: 3008
  IiifLambdaTimeout:
    Type: Number
    Description: The timeout for the lambda.
    Default: 10
  PixelDensity:
    Type: Number
    Description: Hardcoded DPI/Pixel Density/Resolution to encode in output images
    Default: 0
    MinValue: 0
  Preflight:
    Type: String
    Description: Indicates whether the function should expect preflight headers
    AllowedValues:
      - false
      - true
    Default: false
  PyramidLimit:
    Type: Number
    Description: Smallest pyramid image dimension. Set to `0` to prevent server from auto-calculating pyramid page sizes.
    MinValue: 0
    Default: 256
  ResolverTemplate:
    Type: String
    Description: A printf-style format string that determines the location of source image within the bucket given the image ID
    Default: "%s.tif"
  SharpLayer:
    Type: String
    Description: >
      ARN of a custom AWS Lambda Layer containing the sharp and libvips dependencies. Use the special value `JP2` 
      to use the managed JPEG2000-compatible layer, or `INTERNAL` to use the built-in dependencies (without JPEG2000
      support).
    AllowedPattern: "^INTERNAL$|^JP2$|^arn:aws:lambda:.*:.*:layer:.+:\\d+$"
    Default: "JP2"
  SourceBucket:
    Type: String
    Description: Name of bucket containing source images
Resources:
  ServerlessIiif:
    Type: AWS::Serverless::Application
    Properties:
      Location:
        ApplicationId: arn:aws:serverlessrepo:us-east-1:625046682746:applications/serverless-iiif
        SemanticVersion: 5.0.6
      Parameters:
        CorsAllowCredentials: !Ref CorsAllowCredentials
        CorsAllowHeaders: !Ref CorsAllowHeaders
        CorsAllowOrigin: !Ref CorsAllowOrigin
        CorsExposeHeaders: !Ref CorsExposeHeaders
        CorsMaxAge: !Ref CorsMaxAge
        ForceHost: !Ref ForceHost
        IiifLambdaMemory: !Ref IiifLambdaMemory
        IiifLambdaTimeout: !Ref IiifLambdaTimeout
        PixelDensity: !Ref PixelDensity
        Preflight: !Ref Preflight
        PyramidLimit: !Ref PyramidLimit
        ResolverTemplate: !Ref ResolverTemplate
        SharpLayer: !Ref SharpLayer
        SourceBucket: !Ref SourceBucket