Command-line interface (CLI) companion tool for Terraform Next.js module for AWS.
It is used for building Next.js apps, deployment and management of deployments.
This covers only the CLI part of the tool, for a full step-by-step tutorial please see our examples.
-
Install the CLI tool
npm i -g tf-next@canary
-
Build the project
tf-next build
-
Deploy the app
tf-next deploy --endpoint https://<api-id>.execute-api.<region>.amazonaws.com > success Deployment package uploaded > success Deployment ready > Available at: https://1e02d46975338b63651b8587ea6a8475.example.com/
To build a Next.js app, run tf-next build
from the directory where your next.config.js
or package.json
is located.
The app is then checked out into a temporary folder and build from there.
Once the build process is finished, a new folder .next-tf
is added to your current working directory.
The .next-tf
folder contains a deployment package that can be used together with the deploy command to deploy your application.
tf-next build
The --skipDownload
flag can be used to prevent the checkout into a temporary folder (builds in the current working directory instead):
tf-next build --skipDownload
The following options can be passed when using the tf-next build
command:
--skipDownload
To publish an previously built Next.js app to the system, run tf-next deploy
from the same directory where the build command was executed from.
tf-next deploy --endpoint <api-endpoint>
The following options can be passed when using the tf-next deploy
command:
--endpoint
--profile
(also available as--awsProfile
)
AWS profile to use for authenticating against the API endpoint. Usesdefault
profile if not specified.
To manage the deployments that are published to the system.
To show the most recent (25) deployments:
tf-next deployment ls
To remove (delete) an existing deployment from the system:
tf-next deployment rm <deployment-id>
To delete an existing deployment including all of the aliases that are associated with it.
tf-next deployment rm <deployment-id> --force
The following options can be passed when using the tf-next deployment
command:
--endpoint
--profile
(also available as--awsProfile
)
AWS profile to use for authenticating against the API endpoint. Usesdefault
profile if not specified.
To managed the aliases that are deployed to the system
Apache-2.0 - see LICENSE for details.