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

ami-resolver

v1.0.0

Published

๐ŸŽก Resolves AMI images available in multiple AWS regions given a base AMI name or identifier.

Downloads

2

Readme

ami-resolver

Resolves AMI images available in multiple AWS regions given a base AMI name or identifier.

PRs Welcome

Current version: 1.0.0

๐Ÿ“‹ Table of contents

๐Ÿš€ Install

To install the ami-resolver command-line tool on your development machine, run the following command :

npm install --global ami-resolver

To verify that the ami-resolver has been correctly installed, run the following command.

$ ami-resolver --version
1.0.0

๐Ÿ”– Features

  • Resolves an AMI list based on an AMI name or identifier across all AWS regions.
  • Outputs readily embeddable AMI mappings for your CloudFormation templates.
  • Supports JSON, YAML and Text outputs.

๐Ÿ“Š Metrics

The below metrics displays approximate values associated with deploying and using this block.

Metric | Value ------ | ------ Type | Tool Installation Time | Less than 1 minute Audience | Developers, Solutions Architect Language | Node.js

๐Ÿ”ฐ Description

This command-line tool allows you to determine, given an AMI in a specific AWS region, its associated AMIs in the other AWS regions. This is especially useful for developers writing CloudFormation templates deploying EC2 instances that require to create mappings of AMIs for the different regions which the CloudFormation template supports.

This application allows you to create AMI mappings automatically using :

  • A base AMI (e.g ami-0de53d8956e8dcf80) in a given AWS region.
  • A base AMI name (e.g amzn2-ami-hvm-2.0.20190313-x86_64-gp2) in a given AWS region.

๐Ÿ›  Usage

Generate an AMI mapping given a base AMI

In order to generate a mapping of AMIs given a base AMI associated with an AWS region, you can run the following command.

ami-resolver --region us-east-1 --output yaml --ami ami-0de53d8956e8dcf80

Here, the base AMI ami-0de53d8956e8dcf80 associated with the region us-east-1 is known, and passing it to ami-resolver will generate the the AMI mapping for all the AWS regions.

AmiRegionMap:
  us-east-1:
    AMI: ami-0de53d8956e8dcf80
  eu-west-3:
    AMI: ami-0451ae4fd8dd178f7
  eu-north-1:
    AMI: ami-d16fe6af
  eu-west-2:
    AMI: ami-09ead922c1dad67e4
  eu-west-1:
    AMI: ami-07683a44e80cd32c5
  ca-central-1:
    AMI: ami-03338e1f67dae0168
  ap-south-1:
    AMI: ami-0889b8a448de4fc44
  sa-east-1:
    AMI: ami-0669a96e355eac82f
  ap-northeast-1:
    AMI: ami-0f9ae750e8274075b
  ap-northeast-3:
    AMI: ami-088d713d672ed235e
  us-east-2:
    AMI: ami-02bcbb802e03574ba
  eu-central-1:
    AMI: ami-09def150731bdbcc2
  ap-northeast-2:
    AMI: ami-047f7b46bd6dd5d84
  ap-southeast-1:
    AMI: ami-0b419c3a4b01d1859
  ap-southeast-2:
    AMI: ami-04481c741a0311bbb
  us-west-1:
    AMI: ami-0019ef04ac50be30f
  us-west-2:
    AMI: ami-061392db613a6357b

Generate an AMI mapping given a base AMI name

In order to generate a mapping of AMIs given an AMI name associated with an AWS region, you can run the following command.

ami-resolver --region us-east-1 --output yaml --ami-name amzn2-ami-hvm-2.0.20190313-x86_64-gp2

Here, the AMI name amzn2-ami-hvm-2.0.20190313-x86_64-gp2 associated with the region us-east-1 is known, and passing it to ami-resolver will generate the the AMI mapping for all the AWS regions.

AmiRegionMap:
  us-east-1:
    AMI: ami-0de53d8956e8dcf80
  eu-west-3:
    AMI: ami-0451ae4fd8dd178f7
  eu-north-1:
    AMI: ami-d16fe6af
  eu-west-2:
    AMI: ami-09ead922c1dad67e4
  eu-west-1:
    AMI: ami-07683a44e80cd32c5
  ca-central-1:
    AMI: ami-03338e1f67dae0168
  ap-south-1:
    AMI: ami-0889b8a448de4fc44
  sa-east-1:
    AMI: ami-0669a96e355eac82f
  ap-northeast-1:
    AMI: ami-0f9ae750e8274075b
  ap-northeast-3:
    AMI: ami-088d713d672ed235e
  us-east-2:
    AMI: ami-02bcbb802e03574ba
  eu-central-1:
    AMI: ami-09def150731bdbcc2
  ap-northeast-2:
    AMI: ami-047f7b46bd6dd5d84
  ap-southeast-1:
    AMI: ami-0b419c3a4b01d1859
  ap-southeast-2:
    AMI: ami-04481c741a0311bbb
  us-west-1:
    AMI: ami-0019ef04ac50be30f
  us-west-2:
    AMI: ami-061392db613a6357b

Changing the mapping output

The ami-resolver command-line tool supports different ways to output the AMI mapping :

  • Json - Creates a CloudFormation compatible AMI mapping in the JSON format.
  • Yaml - Creates a CloudFormation compatible AMI mapping in the YAML format.
  • Text - Creates a textual output of the AMI mapping (this is the default choice when the --output option is not specified).

JSON Output

{
  "AmiRegionMap": {
    "us-east-1": {
      "AMI": "ami-0de53d8956e8dcf80"
    },
    "eu-west-3": {
      "AMI": "ami-0451ae4fd8dd178f7"
    },
    "eu-north-1": {
      "AMI": "ami-d16fe6af"
    },
    "eu-west-2": {
      "AMI": "ami-09ead922c1dad67e4"
    },
    "eu-west-1": {
      "AMI": "ami-07683a44e80cd32c5"
    },
    "ap-south-1": {
      "AMI": "ami-0889b8a448de4fc44"
    },
    "ap-northeast-3": {
      "AMI": "ami-088d713d672ed235e"
    },
    "ca-central-1": {
      "AMI": "ami-03338e1f67dae0168"
    },
    "sa-east-1": {
      "AMI": "ami-0669a96e355eac82f"
    },
    "ap-northeast-1": {
      "AMI": "ami-0f9ae750e8274075b"
    },
    "us-east-2": {
      "AMI": "ami-02bcbb802e03574ba"
    },
    "eu-central-1": {
      "AMI": "ami-09def150731bdbcc2"
    },
    "ap-northeast-2": {
      "AMI": "ami-047f7b46bd6dd5d84"
    },
    "ap-southeast-1": {
      "AMI": "ami-0b419c3a4b01d1859"
    },
    "us-west-1": {
      "AMI": "ami-0019ef04ac50be30f"
    },
    "ap-southeast-2": {
      "AMI": "ami-04481c741a0311bbb"
    },
    "us-west-2": {
      "AMI": "ami-061392db613a6357b"
    }
  }
}

YAML Output

ami-resolver --region us-east-1 --output yaml --ami ami-0de53d8956e8dcf80
AmiRegionMap:
  us-east-1:
    AMI: ami-0de53d8956e8dcf80
  eu-west-3:
    AMI: ami-0451ae4fd8dd178f7
  eu-north-1:
    AMI: ami-d16fe6af
  eu-west-2:
    AMI: ami-09ead922c1dad67e4
  eu-west-1:
    AMI: ami-07683a44e80cd32c5
  ca-central-1:
    AMI: ami-03338e1f67dae0168
  ap-south-1:
    AMI: ami-0889b8a448de4fc44
  sa-east-1:
    AMI: ami-0669a96e355eac82f
  ap-northeast-1:
    AMI: ami-0f9ae750e8274075b
  ap-northeast-3:
    AMI: ami-088d713d672ed235e
  us-east-2:
    AMI: ami-02bcbb802e03574ba
  eu-central-1:
    AMI: ami-09def150731bdbcc2
  ap-northeast-2:
    AMI: ami-047f7b46bd6dd5d84
  ap-southeast-1:
    AMI: ami-0b419c3a4b01d1859
  ap-southeast-2:
    AMI: ami-04481c741a0311bbb
  us-west-1:
    AMI: ami-0019ef04ac50be30f
  us-west-2:
    AMI: ami-061392db613a6357b

Text Output

ami-resolver --region us-east-1 --output text --ami ami-0de53d8956e8dcf80
Region us-east-1 - ami-0de53d8956e8dcf80
Region eu-west-3 - ami-0451ae4fd8dd178f7
Region eu-north-1 - ami-d16fe6af
Region eu-west-2 - ami-09ead922c1dad67e4
Region eu-west-1 - ami-07683a44e80cd32c5
Region ap-south-1 - ami-0889b8a448de4fc44
Region ca-central-1 - ami-03338e1f67dae0168
Region sa-east-1 - ami-0669a96e355eac82f
Region ap-northeast-3 - ami-088d713d672ed235e
Region ap-northeast-1 - ami-0f9ae750e8274075b
Region us-east-2 - ami-02bcbb802e03574ba
Region eu-central-1 - ami-09def150731bdbcc2
Region ap-northeast-2 - ami-047f7b46bd6dd5d84
Region ap-southeast-1 - ami-0b419c3a4b01d1859
Region us-west-1 - ami-0019ef04ac50be30f
Region ap-southeast-2 - ami-04481c741a0311bbb
Region us-west-2 - ami-061392db613a6357b

Note that the --output option can be used whether you are generating an AMI mapping given an AMI or an AMI name.

๐Ÿ‘€ See also