DEV Community

Cover image for Quickly build and deploy Nodejs lambda to AWS with Terraform
Junius Lekgoara
Junius Lekgoara

Posted on • Updated on

Quickly build and deploy Nodejs lambda to AWS with Terraform

To kick us off we want to install create-aws-tf-lambda utilizing your preferred nodejs package manager.

NB: before we start make AWS account, save the secret and access key in your environment variables or configure it using aws cli

Install create-aws-tf-lambda

npm i create-aws-tf-lambda -g

Create project

Make a new a projet/lambda by running the the following command

create-aws-tf-lambda

create-aws-tf-lambda

cd into the orderStatus project and run build

npm run build

cd into terraform directory, run terraform init then plan and apply


terraform init
terraform plan
terraform apply

congratulations you have deployed your lambda to AWS in less than 60 seconds.

Top comments (0)