A CLI utility to deploy static websites to the cloud

Usage no npm install needed!

<script type="module">
  import laita from '';



Build Status Dependencies npm version License Sponsored

A CLI utility to easily deploy static websites to the cloud

Supported targets:

  • AWS S3 + Cloudfront
  • Azure Storage + Azure CDN
  • GCP Cloud Storage
  • Netlify
  • Heroku


  • Node.js
  • Terraform


npm install -g laita

Quick start

laita config # follow interactive prompts to create .laitarc config
laita provision # provision selected cloud infra using terraform
laita deploy # deploy the static website to the provisioned infra


Laita uses a .laitarc file to store its configuration.

You can generate configurations interactively using the laita config command.

The .laitarc file contents look like this:

  source: public/
  target: aws-s3-cloudfront
  region: eu-west-1
  bucketName: laita-static-default-2094db20
  createCloudFront: true
  acmCertificateARN: arn:aws:acm:us-east-1:921809084865:certificate/c0b7309b-39cc-4925-9df3-bcedf78b92f8


Configuration with laita config

$ laita config
? Static files directory? public/
? Choose method aws-s3-cloudfront
? AWS Region? eu-west-1
? S3 bucket name? laita-static-default-2094db20
? Create CloudFront distribution? (needed to use custom domains) Yes
? Add a domain name? (leave empty to continue)
? Add another domain name? (leave empty to continue)
? Add ACM certificate? (needed to use custom domains) Yes
? ACM Certificate ARN? 	arn:aws:acm:us-east-1:921809084865:certificate/c0b7309b-39cc-4925-9df3-bcedf78b92f8
? Store terraform state remotely? s3
? Terraform bucket name laita-terraform-d40cb707
? Terraform bucket region eu-west-1
? Create bucket now? Yes
----> Running "aws s3api create-bucket --bucket laita-terraform-d40cb707 --region eu-west-1 --create-bucket-configuration LocationConstraint=eu-west-1"...
Config written to .laitarc

Provisioning with laita provision

$ laita provision
Provisioning AWS S3 + Cloudfront resources... (stage: default)
----> Running "terraform init"...
Initializing modules...
- cloudfront_distribution_default in cloudfront-distribution

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...

Terraform has been successfully initialized!


Plan: 2 to add, 0 to change, 0 to destroy.


? Apply changes? Yes
----> Running "terraform apply -auto-approve -target module.s3_website_default -target module.cloudfront_distribution_default"...

module.s3_website_default.aws_s3_bucket.static: Creating...
module.s3_website_default.aws_s3_bucket.static: Creation complete after 7s [id=laita-static-default-2094db20]
module.cloudfront_distribution_default.aws_cloudfront_distribution.static: Creating...
module.cloudfront_distribution_default.aws_cloudfront_distribution.static: Creation complete after 28m42s [id=EW9JZP1F0BO3L]
module.cloudfront_distribution_default.aws_cloudfront_distribution.static: Creation complete after 28m42s [id=EW9JZP1F0BO3L]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.


cloudfront_endpoint_default =
s3_endpoint_default =

Deployment with laita deploy

$ laita deploy
Deploying site to S3... (stage: default)
----> Running "aws s3 sync --delete public/ s3://laita-static-default-2094db20"...
upload: public/bundle.css to s3://laita-static-default-2094db20/bundle.css
upload: public/index.html to s3://laita-static-default-2094db20/index.html
upload: public/global.css to s3://laita-static-default-2094db20/global.css
upload: public/favicon.png to s3://laita-static-default-2094db20/favicon.png
upload: public/.DS_Store to s3://laita-static-default-2094db20/.DS_Store
upload: public/ to s3://laita-static-default-2094db20/
upload: public/bundle.js to s3://laita-static-default-2094db20/bundle.js
upload: public/images/anttiviljami.jpg to s3://laita-static-default-2094db20/images/anttiviljami.jpg
upload: public/ to s3://laita-static-default-2094db20/