January 2024 - Launch and Website Module


We’re live and have shipped our first module!

Here’s a quick overview of what’s new:

  • Website - A simple website hosted on AWS utilizing OpenNext architecture made for Next.js based sites.

Website

We’ve added a website module for hosting Next.js based sites on AWS. It has full support for API routes, SSG, SSR, ISR, and more.

This architecture is based on utilizing OpenNext for generation of the site bundles. Refer to OpenNext for more information on what Next.js features it supports.

Utilization

Below is how you’d reference the Website module in your Terraform configuration with some configurations provided. Refer to the Website docs for full configuration options.

Code
module "website" {
  source = "path-to-copied-website-module"

  server_function_config = {
    filename = "server.zip"
  }

  image_optimization_function_config = {
    filename = "image-optimization.zip"
  }

  revlidation_function_config = {
    filename = "revlidation.zip"
  }

  warmer_function_config = {
    filename = "warmer.zip"
  }
}

To prepare the zip files required for this module, you’ll need to utilize the open-next CLI to generate the zip bundles. Refer to OpenNext for the latest commands.

As of open-next v2.3.4, the following command will generate the zip bundles:

npx open-next@v2.3.4 build

Was this page helpful?