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-package-cli

v1.0.3

Published

A packaging tool for your Cloudformation stacks.

Downloads

8

Readme

cfn-package

A packaging tool for your Cloudformation stacks.

CodeFactor

Current version: 1.0.0

Lead Maintainer: Halim Qarroum

Table of contents

Installation

Using NPM

# Installs the `cfn-package` command-line.
npm install --save cfn-package-cli

# Installs the `cfn-python-lint` tool.
pip install cfn-lint

# Installs the `cfn-nag` security audit tool.
gem install cfn-nag

Please make sure that the aws-cli is installed on your system, and has the appropriate permissions to upload S3 assets to the given bucket and validate your template.

Features

  • Recursively packages your Cloudformation stacks and sub-stacks into one ready-to-deploy template.
  • Runs the AWS static and advanced linters on your templates.
  • Runs cfn_nag to detect security issues with your templates.
  • Automatically runs an npm install on your Node.js Lambda functions to generate the node_modules directory before packaging them up.

Description

The cfn-package tool makes it possible to package your Cloudformation templates using the regular package command given a project on the filesystem containing multiple nested Cloudformation stacks. The resulting packaged Cloudformation template you can then reference in your deployment will be named cfn.package.yml by default, and placed at the root of the directory you referenced when running the command.

This tool also enforces error free deployments while packaging your template by running the validate-template command, as well as the AWS cfn-lint command as well. To avoid possible security vulnerabilities in your architecture, cfn_nag is also executed across all your templates at packaging time.

Note that in order to use the aforementioned third-party tools, you need to have them available in your PATH. If a third party tool is not available, a warning will be issued by cfn-package.

Usage

You will find below a description of the options made available by cfn-package, as well as different usage examples of how to package your templates.

Available options

The cfn-package command implements different options that you can use as part of your continuous integration process to package your Cloudformation stacks.

  • --bucket - The name of the S3 bucket to which the generated assets will be uploaded by the AWS CLI.
  • --template - The path to the root cloudformation template you would like to package.
  • --enforce-missing-tools - Issues an error if one of the validation tools are not available on the local machine.
  • --output-file - Specifies an alternative file on the filesystem for the generated packaged template. The default is to write the resulting packaged template into a cfn.package.yml file in the same directory as the given template.
  • --log-output-file - Specifies a file on the filesystem to which debugging logs will be written.

Packaging a directory

In order to package a directory containing your AWS Cloudformation templates along with every nested templates, run the following command.

cfn-package --template ./cloudformation/cloudformation-template.yml --bucket my-output-bucket

See also

  • aws-blocks - A package manager for AWS Cloudformation and a repository for reusable stacks.
  • cfn_nag - Linting tool for CloudFormation templates.
  • cfn-python-lint - CloudFormation Linter.