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

terraform-plan-applier

v0.2.1

Published

Uses terraform-plan-parser to convert plan into json. Then reads from a yaml file to look for acceptable changes. If a specific target has all acceptable changes listed for it, then it will run `terraform apply` with only that specific target as well as o

Downloads

9

Readme

terraform-plan-applier

Uses terraform-plan-parser to convert plan into json. Then reads from a yaml file to look for acceptable changes. If a specific target has all acceptable changes listed for it, then it will run terraform apply with only that specific target as well as other targets that meet the criteria.

Setup

npm i -g terraform-plan-applier

Usage

Setup apply.yml

The following will allow an asg named blue for any service to have an additional subnet using the regex for new. Since it's adding the subnet, the old value will be empty. Running the script using this yaml file will return a list of targets or it can be configured to run terraform apply -auto-approve. If any of the attribute criteria fails, the target resource will be omitted.

changedResources:
- path: 'module\..*\.module\.service\.module\.blue\.aws_autoscaling_group\..*'
  attributes:
    # allow only if vpc_zone_identifier is added one of 2 subnets
    - name: 'vpc_zone_identifier\.[\d]+'
      old: ''
      new: subnet-ac7b95a3|subnet-d74eeda1
$ terraform-plan-applier -h
Usage: terraform-plan-applier [options]

Options:
  -V, --version        output the version number
  -c, --config <file>  required config criteria yaml to apply
  -p, --plan [file]    optional output of `terraform plan` which can be piped in
  --apply              Executes `terraform apply -auto-approve` if criteria is matched
  -v, --verbose        verbose mode
  -h, --help           output usage information

Dry Run Examples:
  $ terraform plan | terraform-plan-apply -c apply.yml
  $ cat terraform-plan.stdout | terraform-plan-apply -c apply.yml
  $ AWS_PROFILE=dev terraform-plan-apply -c apply.yml < terraform-plan.stdout

Apply Examples:
  $ terraform-plan-apply --config apply.yml --apply < terraform-plan.stdout
  $ AWS_PROFILE=dev terraform-plan-apply --config apply.yml --apply < terraform-plan.stdout

Contribute

If you have time, please contribute! Standard fork, branch, PR model.

TODO

  • [ ] option to save plan output check to local file
  • [ ] option to save applied output to local file
  • [ ] allow action to be set e.g. update, replace, destroy
    • also account for plan numbers like Plan: 2 to add, 2 to change, 2 to destroy. for more precise matching. If this fails, do not continue.
  • [ ] investigate support for module / type attribute searching
    • how much more value does this bring?