Skip to content

Serverless Framework

The NSHM project uses the Serverless Framework from serverless.com to standardise and simplify devops for AWS service deployment.

Each NSHM API has a serverless.yml file which describes the API deployment. Serverless is deployed locally using NPM, and provides developer commands that, with the appropriate access permissions, can deploy, manage, and interact with the application stack from a developer machine. These same commands in github CI/CD scripts to automate deployment into the TEST and PROD environments.

serverless.yml

The Serverless.yml Reference is the canonical guide. We use the serverless.yml to:

  • define the application name, and components.
  • control the stages and regions where deployments occur.
  • define any additional AWS resources and permissions.
  • configure serverless plugins (such as lamabda warming functions).

Serverless CLI

Here, the CLI reference is canonical. We commonly ese these commands for local devops:

Future / Alternatives

When NSHM services were originally developed (2020-2022) serverless framework was non commercial. That has now changed, requiring users to register services using the V4 API. Users must also declare whether these are eligible for free or paid usage. This change is effective from V4, and will soon be required for all projects, because of version support limits on the old API.

One of the key 'advantages' for the serverless.conm framework is support for cloud providers other than AWS. However, for NSHM the effort involved in such a migration might be too large to consider in the foreseable future.

Alternative options: