New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

aws-webdeploy

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-webdeploy

Commandline tool used to deploy a web application.

Source
npmnpm
Version
2.1.1
Version published
Weekly downloads
2
-97.1%
Maintainers
1
Weekly downloads
 
Created
Source

aws-webdeploy

Tiny utility to allow configuring a web application deployment from your package.json and leverage AWS-CDK.

NPX Usage (Option 1)

Add the webdeploy section to your package.json file. (see below for more options)

  "webdeploy": {
    "distPath": "./dist",
    "resourcePrefix": "test-web-stack"
  }

Then just do this:

npx aws-webdeploy

Integrated as npm-script (Option 2)

TLDR; Install this along with the AWS CDK CLI (installed globally) and you can yarn deploy your static website out of your dist directory.

Full example project

https://github.com/dsandor/aws-webdeploy-example

asciicast

What are the pre-requisites?

package.json webdeploy settings

In its simplest form you only need to add the following section to your package.json file. Here you are specifying the location of your static website files ./dist/ in this case. You are also specifying a prefix to use for your AWS Resources in the CloudFormation stack. This should be a unique prefix to avoid collision with your S3 bucket name. Pick something like www-mywebsite-com which is unique and descriptive.

  "webdeploy": {
    "distPath": "./dist",
    "resourcePrefix": "test-web-stack"
  }

Add the deploy script to your package.json

Add the following to your package.json file:

  "scripts": {
    "deploy": "cdk deploy --app node_modules/aws-webdeploy/deploy.js"
  },

How to deploy?

yarn deploy

-or-

npm run deploy

This kicks off the cdk deploy command and uses a small cdk app that will use the parameters you configured in your package.json file.

Full package.json file settings

propertydescription
websiteDistPathThe HTML files to be deployed. e.g. ./dist
deploymentVersionA version number for your deployment.
resourcePrefixUsed to group resources with a prefix. The S3 bucket is prefixed with this value.
indexDocumentindex document for your website. default: index.html
certificateArnthe ARN for the SSL certificate for your website. (optional)
domainNamesan array of strings representing your website domain name (must match the certificate) e.g. ['mydomain.com', 'www.mydomain.com']

Please note that if you wish to use your own domain names and not just the Cloud Front Distribution URL you will also need a certificate. It is very simple to create a certificate in AWS console and it is free (assuming you are supporting modern browsers only). Once you have the ARN for your certificate use the certificateArn property. You will also need to provide the domain names to the domainNames property. The domain names MUST MATCH the domain names you put on your certificate.

What gets created for me?

  • CloudFront Distribution
  • CloudFront Origin that maps to a versioned folder in an S3 bucket
  • Correct permissions to disallow public access to the S3 bucket.
  • Correct permissions for CloudFront to serve the files from S3
  • S3 Bucket for the website assets (placed into a folder based on deploymentVersion value)

FAQs

Package last updated on 18 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts