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

template-configuration

v1.2.1

Published

CloudFormation + CodePipeline Template Configuration For CLI Tools

Downloads

13

Readme

CloudFormation + CodePipeline Template Configuration For CLI Tools

Making development closer to production use of CodePipeline

See Limitations section towards the bottom

Supported CLI Tools

Fed up of the following commands all differing in their parameter overrides and tags parameter formats? and them all differing from how CloudFormation Actions in CodePipeline are configured?

Then do one of these:

$ tc aws cloudformation deploy ...
$ tc aws cloudformation create-change-set ... 
$ tc sam deploy ... 
$ tc rain deploy ...

With a template configuration file template-configuration/default.json (see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-cfn-artifacts.html#w2ab1c21c17c15)

{
  "Parameters": {
    "Key": "Value"
  },
  "Tags": {
    "TagKey": "TagValue"
  }, 
  "StackPolicy": {
    "Statement": [
      {
        "Effect": "Allow",
        "NotAction": "Update:Delete",
        "Principal": "*",
        "Resource": "*"
      }
    ]
  }
}

And do away with your flakey non-production-like deploy scripts, and stop doing these:

$ aws cloudformation deploy \
  --parameter-overrides \
    Key=Value \
    Key2=Value2 \
  ...
$ aws cloudformation create-change-set \
  --parameters \
    ParameterKey=Key,ParameterValue=Value \
    ParameterKey=Key2,ParameterValue=Value2 \
  ...
$ sam deploy \
  --parameter-overrides \
    ParameterKey=Key,ParameterValue=Value \
    ParameterKey=Key2,ParameterValue=Value2 \
  ...
$ rain \
  --params \
    Key=Value,Key2=Value2

Implicit Proxy

Add the following to your shell rc/profile file to replace aws, sam, and/or rain with implicit tc proxying (e.g. ~/.bashrc, ~/.zshrc, etc)

aws () { template-configuration "$0" "$@" }
sam () { template-configuration "$0" "$@" }
rain () { template-configuration "$0" "$@" }

Then tc is implicit and no longer needed

$ aws cloudformation deploy ...
$ aws cloudformation create-change-set ...
$ sam deploy ...
$ rain deploy ...

Limitations

  • only supports commands without global arguments between them (where they would otherwise be supported)
    • supported aws cloudformation deploy ... --profile <profile> --region <region>
    • not-supported aws --profile <profile> --region <region> cloudformation deploy ...
  • only supports proxying to help commands where help arguments are the last argument e.g. aws cloudformation deploy help
  • does not and does not plan to support merging each commands existing parameter arguments with a template configuration file
  • [ ] add support for tc --parameters ... [cmd ...] for 1 single way override template configuration file values
  • [ ] test / add support for parameters with quoted values
  • [ ] support UsePreviousValue
  • [ ] tc help --help -h
  • [ ] support StackPolicy for those commands that support it, and maybe do 2nd api call if needed for those where it is not

Arguments

Some arguments can come before the proxied command e.g. tc <here> aws ...

  • tc init create a template-configuration/default.json file, with optional additional --config argument
  • --debug echos out the command that is also ran
  • --dryrun only echo out the command that would otherwise be ran – implies --debug
  • --config <configuration-file> override template-configuration/default.json with another local file path
    • e.g. tc --config template-configuration/test.json sam deploy ...