Skip to content

Commit

Permalink
Template & Documentation Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Aug 23, 2023
1 parent 25658d6 commit 42c546d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Previous versions of this application featured an optional [CloudFront](https://

While the CloudFront-enabled version of the application is no longer available in the Serverless Application Repository, the newly created [`examples`](./examples/README.md) directory includes sample [CloudFormation](https://aws.amazon.com/cloudformation/) templates and [Terraform](https://terraform.io/) manifests showing how to deploy the IIIF service as part of a larger application/infrastructure stack.

### Breaking Changes from Version 4.x

- The value of the `SharpLayer` variable must now be one of `INTERNAL`, `JP2`, or a valid Lambda layer ARN in the same region the
application is being deployed in. The new default is `JP2`, which behaves the same as the former default (empty string). The new
value, `INTERNAL`, uses the `sharp` and `libvips` dependencies compiled into the application itself.

## Description

A IIIF [2.1](https://iiif.io/api/image/2.1/) and [3.0](https://iiif.io/api/image/3.0/) Image API compliant server written as an [AWS Serverless Application](https://aws.amazon.com/serverless/sam/).
Expand All @@ -19,7 +25,6 @@ A IIIF [2.1](https://iiif.io/api/image/2.1/) and [3.0](https://iiif.io/api/image
* A simple [Lambda Function](https://aws.amazon.com/lambda/) wrapper for the [iiif-processor](https://www.npmjs.com/package/iiif-processor) module.
* A [Lambda Function URL](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) that is used to invoke the IIIF API via HTTPS.
* A [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) containing all the dependencies for the Lambda Function.
* An optional [CloudFormation](https://aws.amazon.com/cloudformation/) template describing the resources needed to deploy the application.

## Prerequisites

Expand Down Expand Up @@ -111,7 +116,7 @@ npm test --coverage
## Custom Sharp Layer
This lambda uses the Sharp layer from https://github.com/samvera/lambda-layer-sharp-jp2/releases in order to get a version of Sharp with jp2 support. You can build your own local version using that code and then deploy your own layer and set that layer in your SAM template.
By default, the application uses a [custom sharp layer](https://github.com/samvera/lambda-layer-sharp-jp2/releases) built with JPEG2000 support. You can supply the ARN of another custom sharp/libvips Lambda layer, or, if you don't need JP2 support, use the value `INTERNAL` to use the precompiled sharp binaries from NPM.

## Advanced Usage

Expand Down
1 change: 1 addition & 0 deletions docs/lib/cfn-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function getParameters() {
}

async function getPropertyList(opts = {}) {
opts = { descPrefix: '', ...opts };
const { compileMdx } = await import('nextra/compile');

const result = getParameters();
Expand Down
3 changes: 2 additions & 1 deletion docs/lib/cfn-tags.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const functionTags = {
'!GetAtt': { type: 'string', quoted: false },
'!Sub': { type: 'string', quoted: true },
'!Ref': { type: 'string', quoted: false }
'!Ref': { type: 'string', quoted: false },
'!Split': { type: 'array', quoted: false }
};

module.exports = Object.entries(functionTags).map(([tag, { quoted }]) => {
Expand Down
12 changes: 6 additions & 6 deletions sam/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Transform: "AWS::Serverless-2016-10-31"
Metadata:
AWS::ServerlessRepo::Application:
Name: serverless-iiif
Description: IIIF Image API 2.1 server backend Lambda function
Description: IIIF Image API 2.1 and 3.0 Service Lambda Function
Author: Samvera
SpdxLicenseId: Apache-2.0
LicenseUrl: ../LICENSE.txt
ReadmeUrl: ../README.md
Labels: ["iiif", "image-processing"]
HomePageUrl: https://github.com/samvera/serverless-iiif
HomePageUrl: https://samvera.github.io/serverless-iiif
SemanticVersion: 5.0.0
SourceCodeUrl: https://github.com/samvera/serverless-iiif
AWS::CloudFormation::Interface:
Expand Down Expand Up @@ -38,7 +38,7 @@ Metadata:
Parameters:
CorsAllowCredentials:
Type: String
Description: |
Description: >
Value of the CORS `Access-Control-Allow-Credentials` response header.
Must be `true` to allow requests with `Authorization` and/or
`Cookie` headers.
Expand All @@ -52,7 +52,7 @@ Parameters:
Default: "*"
CorsAllowOrigin:
Type: String
Description: |
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
Expand Down Expand Up @@ -94,7 +94,7 @@ Parameters:
Default: false
PyramidLimit:
Type: Number
Description: Smallest pyramid image dimension. Set to 0 to prevent server from auto-calculating pyramid page sizes.
Description: Smallest pyramid image dimension. Set to `0` to prevent server from auto-calculating pyramid page sizes.
MinValue: 0
Default: 256
ResolverTemplate:
Expand All @@ -103,7 +103,7 @@ Parameters:
Default: "%s.tif"
SharpLayer:
Type: String
Description: |
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).
Expand Down

0 comments on commit 42c546d

Please sign in to comment.