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

terragrunt-status

v1.3.0

Published

Describes the deployment status of multiple Terragrunt-managed Terraform stacks

Downloads

19

Readme

terragrunt-status

CircleCI npm GitHub issues npm Depfu

terragrunt-status is a small script that tells you which stacks in Terragrunt are deployed, and if they are out of date.

A recording of terragrunt-status in use

What it can do

  • When ran in a folder containing Terragrunt-managed infrastructure, it will retrieve the dependency graph
  • It will then check the output of terragrunt state list in each folder to check if it is deployed
  • If the stack is deployed, it will check the output of terragrunt plan -detailed-exitcode -compact-warnings -refresh=false -lock=false to see if the stack code is up to date with the state. (Note: It does not refresh the statefile by default. This can be overridden with --refresh)
  • Will display this information

What it WILL do (eventually)

  • Show the information prettily
  • Will handle different edge-cases and errors from Terragrunt/Terraform
  • Will be able to generate apply-all and destroy-all commands that exclude deployed/non-deployed stacks (to work around issues like terragrunt-io/terragrunt#1394)

What it MIGHT do (if there's interest / if I end up needing it)

  • Optionally will be able to run things like terragrunt init if it's needed
  • Be able to iterate through stacks in order and run commands as a wrapper around Terragrunt
  • Maybe have a cool interactive CLI menu with tickboxes and stuff to choose stacks and then it'll do it in the right order with dependencies and stuff? I dunno I haven't thought that far ahead.

Installation

NPM

  • npm install -g terragrunt-status

Manual

  • git clone https://github.com/Makeshift/terragrunt-status
  • cd terragrunt-status
  • npm install --production (if you forget --production you'll be downloading a lot more packages!)
  • Run ./terragrunt-status.js <dir>

Usage

Usage: terragrunt-status [-h|--help] [--debug] [-r|--refresh] [-d|--deploy-order] [-x|--destroy-order] [<path_to_infrastructure>]

This tool describes the deployment status of multiple Terragrunt-managed Terrarform stacks.

Where:
  -h|    --help            Show this help text
----
  --debug                  Shows extra output
----
  -d     --deploy-order    Outputs a legal deploy order for the given stacks, then exits
  -x     --destroy-order   Outputs a legal destroy order for the given stacks, then exits
  -r     --refresh         Locks and refreshes statefiles (This will increase the time taken to get a result, but may be more accurate to the live deployment)
----
  <path_to_infrastructure> Path to your Terragrunt infrastructure definition - If not provided, assumed to be current working directory.

Note: If you're using aws-vault, you should run this script in an aws-vault session, with the command:
  aws-vault exec <profile> -- terragrunt-status.js

Known issues

  • The code is ugly and not particularly efficient (I wrote it in a hurry)
  • The output is pretty meh, but workable.