You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

simple-s3-deploy

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-s3-deploy

A simple package to deploy static files to your AWS S3 bucket.

1.1.0
latest
Version published
Weekly downloads
25
-37.5%
Maintainers
0
Weekly downloads
 
Created

Simple S3 Deploy

Simplest way to deploy static files to S3 bucket in aws.

Installation

Install with npm

  npm install simple-s3-deploy

Usage

const s3Deploy = require("simple-s3-deploy")

// Specify required data
const deployOptions = 
{
  ID : "AKIAULL....",
  SECRET : "HWr+7+NEYnPG.....",
  BUCKET_NAME : "my-bucket",
  DEPLOY_FOLDER_PATH : "./dist/",
  CACHE : 
  {
    ID : "XXXXXXXXXXXXXX",
    QUANTITY : 1,
    PATH : ["/*"],
  }
}

// Deploy
s3Deploy.deploy(deployOptions);

Parameters

deplay(deployOptions)

Takes deployOptions and deploys files to S3 bucket.

Deploy Options Keys :

KeysSampleDescription
IDstringRequired. Your AWS access key Id.
SECRETstringRequired. Your AWS access key Secret.
CROSS_ACCOUNT_ROLEarn:aws:iam::99999999:role/devOptional. Your AWS role arn.
BUILD_CMDng buildOptional. CMD build command to build project.
BUCKET_NAMEmy-bucketRequired. Your AWS S3 Bucket name where you eat to deploy code.
DEPLOY_FOLDER_PATH./dist/appRequired. Local folder path where deployable files are build.
IGNORE_FILES[ "node_module", ".DS_Store" ]Optional. Files that you dont want to upload.
CACHE{ ID : "E17G7YNEXAMPLE", QUANTITY : 1, PATHS : ["/*"] }Optional. Specify if you have distribution and you want to invalidate cache.
ACLstringOptional. Valid Values: private | public-read | public-read-write | authenticated-read | aws-exec-read | bucket-owner-read | bucket-owner-full-control

CACHE Options Keys :

KeysTypeSampleDescription
IDstringE17G7YNEXAMPLERequired. Distribution Id where you want to create invalidation to clear cache.
QUANTITYnumber1Required. Number of file to delete.
PATHSArray["/*"]Required. List of paths that you want to clear. (["/*"] to invalidate all files)

License

MIT

FAQs

Package last updated on 01 Aug 2024

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