npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@axel669/aws-deploy

v0.4.7

Published

```bash aws-deploy <env> <command> <...targets>

Downloads

18

Readme

AWS Deploy

Commands

aws-deploy <env> <command> <...targets>

aws-deploy dev deploy
aws-deploy - deploy

env is the name of an environment optionally defined in the aws-deploy.yml file, or - if no configured variables are needed.

  • deploy

    deploys the listed targets, or iterates over the deployment.resources list if target is all

  • list

    lists the resources that have been deployed in the current environment based on the tags provided in the config file

  • validate-config

    validates the config file without deploying any resources, and prints out the json of the config with all environment variable interpolations

Targets

Deploy targets are in the form <service>:<id>, where service is a service prefix and id is the key within the config file in the resources.

| Service | Prefix | | --- | --- | | Lambda | lambda | | S3 | s3 | | API Gateway | apig |

Config File

Must be named aws-deploy.yml

Config file can use environment variables with $${<system environment variable>}. Config file can use values from the front matter env with $${.<env variable>}.

Env vars will be interpolated for any string value (NOT keys). If the var substitution results in the full value being "undefined", it will be treated as an empty value.

Extra Environment Variables

aws-deploy will also add some environment variables automatically that can be used in the configuration file.

| Name | Description | | --- | --- | | env | The environment name from the command |

# front matter environments
---
dev:
  bucket:
    name: $${DEV_BUCKET}
live:
  bucket:
    name: $${PROD_BUCKET}
---

# AWS profile name
profile: default
# AWS region
region: us-west-1

# Lambda functions
lambda:
  # The key serves as the id for deployment targets
  first:
    # Lambda name. Full name in AWS will be prefix + name
    name: aws-test
    # Directory containing the code
    dir: first-func
    # Optional. Lambda runtime, check aws for valid values
    runtime: nodejs16.x
    # Optional. Lambda memory size in MB
    memory: 128
    # Optional. Lambda timeout in seconds
    timeout: 4
    # Optional. List of IAM policies (the Statement array)
    iam:
      - Effect: Allow
        Action:
          - s3:GetObject
          - s3:PutObject
        Resource:
          - "*"
    # Optional. Object of environment variables for the lambda
    env:
      tag: env/$${env}

# S3 buckets
s3:
  # The key serves as the id for deployment targets
  site:
    # Directory containing files to sync
    dir: source
    # Bucket name. Does not have prefix prepended
    name: $${.bucket.name}
    # optional prefix to use with the bucket keys
    prefix: stuff
    # optional access block settings to control if acl or policy block
    # is in place for the bucket
    # any key omitted in the object defaults to true (block public access)
    blockPublic:
      policy: false
      acl: true
    # optional bucket policy to apply
    policy:
    - Effect: Allow
      Principal: "*"
      Action:
      - s3:GetObject
      Resource: arn:aws:s3:::$${.bucket.name}/*
    # enable bucket website hosting. index entry is require, error is optional
    website:
      index: index.html
      error: 404.html

# API Gateway
apig:
  main:
    # name of the api
    name: "AWS Deploy Test"
    # stage to deploy to
    stage: $${env}
    stageVars:
      blep: old value
    # CORS settings for the api
    cors:
      origins:
      - "*"
      methods:
      - GET
      - POST
      headers:
      - cookie
      - content-type
      maxAge: 1000
      credentials: false
      expose:
      - date
    # authorizers
    auth:
      test:
        # currently only lambda authorizers are supports
        type: function
        # the key of a function defined in lambda, or the fully resolved name
        # of a lambda starting with "@" (ex: @some-external-function)
        func: auth
        cache: 0
        idSource:
        - $request.header.key
    # api integrations, but integrations is harder to type
    actions:
      postman-get:
        # only http and function currently supported
        type: http
        url: "https://postman-echo.com/get"
        method: "get"
      lambda-example:
        type: function
        func: first
        # version of lambda is optional
        version: 1
      site-index:
        type: http
        url: https://s3.us-west-1.amazonaws.com/{app}/index.html
        method: get
      site-files:
        type: http
        url: https://s3.us-west-1.amazonaws.com/{page}
        method: get
        # optionally set request parameter mappings using the format
        # [append|overwrite|remove]:[header|queryString|path].[name]: value
        requestParams:
          overwrite:header.host: $${.bucket.name}
    # api routes
    # method needs to be capitalized, and key needs to have any route variables
    # and/or proxy
    routes:
      "GET /":
        action: lambda-example
        auth: test
      "GET /{app}/static":
        action: site-index
      "GET /static/{page+}":
        action: site-files
      "POST /":
        action: postman-get

# Production deployment info
deployment:
  # Resources to deploy for production, uses the normal targets syntax
  resources:
    - "lambda:first"
    - "s3:site"