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

cfn-featurestack

v1.1.0

Published

Simple utility for creating temporary AWS CloudFormation stacks (featurestacks) for feature branches

Downloads

7

Readme

cfn-featurestack

Simple utility for creating temporary AWS CloudFormation stacks (featurestacks) for feature branches

Configuration

cfn-featurestack will by default use any locally pre-configured AWS account. You can pre-configure your account by any of the following methods:

  • With aws-cli, by running aws-cli configure (Recommended for local environments)
  • Set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_PROFILE and AWS_REGION environment variables (Recommended for server/container environments)
  • Directly configure to .aws\config and .aws\credentials files

Additionally, you can define your AWS access and secret keys as parameters, but this is not recommended as they A) can end to version control or B) will stay readable in logs.

Usage

cfn-featurestack will add IsFeatureStack parameter to your stack parameters, which enables you to set conditions for CloudFormation not to create specific resources for featurestacks (such as CloudFront distributions and Route53 domain names).

Preparing CloudFormation template

  1. Add IsFeatureStack parameter and conditions for it.
Parameters:
  IsFeatureStack:
    Description: "Is this a feature stack. (Defaults to \"false\")"
    Type: String
    Default: "false"

Conditions:
  IsNotFeatureStack: !Equals [ !Ref IsFeatureStack, "false" ]
  IsFeatureStack: !Equals [ !Ref IsFeatureStack, "true" ]
  1. Add IsNotFeatureStack to any resource that must be unique across stacks and cannot be duplicated to feature stacks, such as CloudFront distributions and Route53 domain names.
Resources:
  CloudFrontDistribution:
    Type: AWS::CloudFront::Distribution
    Condition: IsNotFeatureStack
    Properties:
      # ...

Command line use

Install

npm install cfn-featurestack -g

Usage

cfn-featurestack --template=./cfn/cfn-stack.yaml

See options for more details.

Package.json script use

Install

npm install cfn-featurestack --save-dev

Usage

Add deploy script to package.json:

{
  "scripts": {
    "deploy": "cfn-featurestack --template=./cfn/cfn-stack.yaml"
  }
}

See options for more details.

Options

template

Path to template file

parameters

Path to parameters file (.json). Multiple parameters options are allowed and values are combined in the order they are defined, with values from latter overwriting previous

Valid .json files:

  • aws-cli cloudformation type:
[
  {
    "ParameterKey": "FirstParam",
    "ParameterValue": "first-param-value"
  },
  {
    "ParameterKey": "SecondParam",
    "ParameterValue": "second-param-value"
  }
]
  • AWS CodePipeline parameters type:
{
  "Parameters": {
    "FirstParam": "first-param-value",
    "SecondParam": "second-param-value"
  }
}
  • Plain JSON object
{
  "FirstParam": "first-param-value",
  "SecondParam": "second-param-value"
}

Multiple parameters files

cfn-featurestack --template=./cfn/cfn-stack.yaml --parameters=./cfn/params1.json --parameters=./cfn/params2.json

region

AWS region

capabilities

AWS IAM capabilities

Valid values:

  • CAPABILITY_IAM
  • CAPABILITY_NAMED_IAM

profile

Load profile from shared credentials file (in .aws\credentials)

access-key

AWS Access Key

secret-key

AWS Secret Access Key

version

Show version number

help

Show help