Example Vercel Next13 App Deployment using CDKTF
This is a minimal example showing how to deploy a Next 13 application on Vercel via CDK for Terraform (cdktf) and the official Vercel Terraform Provider.
Project setup
Follow these 5 easy steps in order to publish the Next13 app to your Vercel account (make sure pnpm
is installed (e.g. via npm i -g pnpm
) and that you have cloned this repo):
- Create an API token in the Vercel Dashboard as described on the Vercel Docs. Use the "Full Access" scope. The token name can be anything you want - however, it's recommended to use ‘terraform’ (as mentioned here).
- Create a
.env
file in thedeployment/
folder and add the token from the previous step asVERCEL_API_TOKEN
to it (as shown in .env.example). - Run
pnpm install
to install all dependencies - Run
pnpm init
to initialize the typescript code bindings for the vercel provider in a.gen
folder. - Run
pnpm deploy
to deploy the app to Vercel.
CDKTF Configuration
You find the actual CDKTF stack under deployment/main.ts.