All Projects → 99stealth → cfn-ami-to-mapping

99stealth / cfn-ami-to-mapping

Licence: MIT license
Generate your CloudFormation RegionMap automatically

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to cfn-ami-to-mapping

kubernetes-ami
A simple AMI and CloudFormation for launching Kubernetes on AWS
Stars: ✭ 41 (+20.59%)
Mutual labels:  cloudformation, aws-ec2
amigen7
Set of tools to provide automation of tasks for creating STIG-partitioned EL7 AMIs
Stars: ✭ 33 (-2.94%)
Mutual labels:  ami, aws-ec2
ami-spec
Acceptance testing your AMIs
Stars: ✭ 47 (+38.24%)
Mutual labels:  ami, aws-ec2
Graylog2 Images
Ready to run machine images
Stars: ✭ 234 (+588.24%)
Mutual labels:  ami, aws-ec2
Udacity Data Engineering Projects
Few projects related to Data Engineering including Data Modeling, Infrastructure setup on cloud, Data Warehousing and Data Lake development.
Stars: ✭ 458 (+1247.06%)
Mutual labels:  cloudformation, aws-ec2
Aws Labs
step by step guide for aws mini labs. Currently maintained on : https://github.com/Cloud-Yeti/aws-labs Youtube playlist for labs:
Stars: ✭ 153 (+350%)
Mutual labels:  cloudformation, aws-ec2
ssm-ami-automation
Automated AMI creation using SSM
Stars: ✭ 14 (-58.82%)
Mutual labels:  cloudformation, ami
nmt
Network mapping tool
Stars: ✭ 16 (-52.94%)
Mutual labels:  mapping
JuliaAutonomy
Julia sample codes for Autonomy, Robotics and Self-Driving Algorithms.
Stars: ✭ 21 (-38.24%)
Mutual labels:  mapping
mageri
MAGERI - Assemble, align and call variants for targeted genome re-sequencing with unique molecular identifiers
Stars: ✭ 19 (-44.12%)
Mutual labels:  mapping
sam-scaffold
A template for an AWS SAM project with continuous integration.
Stars: ✭ 80 (+135.29%)
Mutual labels:  cloudformation
deck.gl-time-series-widget
A React Time Slider implementation for DECK.GL - (non)temporal data - by CPU filtering ⌛
Stars: ✭ 19 (-44.12%)
Mutual labels:  mapping
cfn-tf-custom-types
CloudFormation Custom Types for Terraform resources.
Stars: ✭ 53 (+55.88%)
Mutual labels:  cloudformation
AmbulanceLocator
Ambulance Locator lets the user find nearby ambulances and as well as call the nearby ambulances.
Stars: ✭ 15 (-55.88%)
Mutual labels:  aws-ec2
EOmaps
A library to create interactive maps of geographical datasets
Stars: ✭ 193 (+467.65%)
Mutual labels:  mapping
30DayMapChallenge
My contributions to the #30DayMapChallenge 2019, a daily challenge focusing on spatial visualizations happening throughout November.
Stars: ✭ 170 (+400%)
Mutual labels:  mapping
WinDirStat.Net
A WPF implementation of WinDirStat.
Stars: ✭ 55 (+61.76%)
Mutual labels:  mapping
ufomap
UFOMap: An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Stars: ✭ 117 (+244.12%)
Mutual labels:  mapping
data-transfer-hub
Seamless User Interface for replicating data into AWS.
Stars: ✭ 102 (+200%)
Mutual labels:  cloudformation
openstreetmap-americana
A quintessentially American map style
Stars: ✭ 89 (+161.76%)
Mutual labels:  mapping

Get AMI IDs per region automatically for your CloudFormation template

Actions Status PyPI version GitHub License Commit Activity

In most cases, people use the Mapping section in CloudFormation to associate AMI IDs with AWS regions as described in THIS example.

I know how is it annoying to manually searching for AMI IDs in different AWS regions and build that map on your own, especially if your map is bigger than one image per region. That's why this tool had been created.

How to install

Install via pip

Ah, that's easy, just run next command

pip install cfn-ami-to-mapping

Or you can build source code

Clone the repository

git clone https://github.com/99stealth/cfn-ami-to-mapping.git
  • Run the command
make install

How to use

Long story short

I also know how it's annoying to read all this stuff. So, enjoy watching 👀 Really fast instruction

Single image

The scenario

There is a requirement for only one image per region.

Ok, all you need to specify it's AMI id and an AWS region where it locates.

cfn-ami-to-mapping --image-id ami-02f706d959cedf892 --top-level-key AMIID --region us-east-2

or instead of AMI id, you may specify the image name

cfn-ami-to-mapping --image-name amzn-ami-hvm-2018.03.0.20190611-x86_64-gp2 --top-level-key AMIID --region us-east-2

Wait several seconds and you will get your autogenerated block of mapping

AMIRegionMap:
  ap-northeast-1:
    AMILinux: ami-04b2d1589ab1d972c
  ap-northeast-2:
    AMILinux: ami-0be3e6f84d3b968cd
  ap-south-1:
    AMILinux: ami-0b99c7725b9484f9e
  ap-southeast-1:
    AMILinux: ami-0fb6b6f9e81056553
  ap-southeast-2:
    AMILinux: ami-075caa3491def750b
  ca-central-1:
    AMILinux: ami-0a67d15f2858e33cb
  eu-central-1:
    AMILinux: ami-026d3b3672c6e7b66
  eu-north-1:
    AMILinux: ami-8c169ef2
  eu-west-1:
    AMILinux: ami-0862aabda3fb488b5
  eu-west-2:
    AMILinux: ami-0bdfa1adc3878cd23
  eu-west-3:
    AMILinux: ami-05b93cd5a1b552734
  sa-east-1:
    AMILinux: ami-0bb96001cf2299257
  us-east-1:
    AMILinux: ami-035b3c7efe6d061d5
  us-east-2:
    AMILinux: ami-02f706d959cedf892
  us-west-1:
    AMILinux: ami-0fcdcdb074d2bac5f
  us-west-2:
    AMILinux: ami-0f2176987ee50226e

Several images

Ok, but there are cases when you should specify several images and Fn::FindInMap them based on some input Parameter or maybe something else.

The scenario

You need to have possibility to swap your infrastructure from Amazon Linux to Amazon Linux 2.

Ok, then try to specify several values:

cfn-ami-to-mapping -i ami-035b3c7efe6d061d5 -k AMILinux -i ami-0b898040803850657 -k AMILinux2 --json

Here's what you'll get:

AMIRegionMap:
  ap-northeast-1:
    AMILinux: ami-04b2d1589ab1d972c
    AMILinux2: ami-0c3fd0f5d33134a76
  ap-northeast-2:
    AMILinux: ami-0be3e6f84d3b968cd
    AMILinux2: ami-095ca789e0549777d
  ap-south-1:
    AMILinux: ami-0b99c7725b9484f9e
    AMILinux2: ami-0d2692b6acea72ee6
  ap-southeast-1:
    AMILinux: ami-0fb6b6f9e81056553
    AMILinux2: ami-01f7527546b557442
  ap-southeast-2:
    AMILinux: ami-075caa3491def750b
    AMILinux2: ami-0dc96254d5535925f
  ca-central-1:
    AMILinux: ami-0a67d15f2858e33cb
    AMILinux2: ami-0d4ae09ec9361d8ac
  eu-central-1:
    AMILinux: ami-026d3b3672c6e7b66
    AMILinux2: ami-0cc293023f983ed53
  eu-north-1:
    AMILinux: ami-8c169ef2
    AMILinux2: ami-3f36be41
  eu-west-1:
    AMILinux: ami-0862aabda3fb488b5
    AMILinux2: ami-0bbc25e23a7640b9b
  eu-west-2:
    AMILinux: ami-0bdfa1adc3878cd23
    AMILinux2: ami-0d8e27447ec2c8410
  eu-west-3:
    AMILinux: ami-05b93cd5a1b552734
    AMILinux2: ami-0adcddd3324248c4c
  sa-east-1:
    AMILinux: ami-0bb96001cf2299257
    AMILinux2: ami-058943e7d9b9cabfb
  us-east-1:
    AMILinux: ami-035b3c7efe6d061d5
    AMILinux2: ami-0b898040803850657
  us-east-2:
    AMILinux: ami-02f706d959cedf892
    AMILinux2: ami-0d8f6eb4f641ef691
  us-west-1:
    AMILinux: ami-0fcdcdb074d2bac5f
    AMILinux2: ami-056ee704806822732
  us-west-2:
    AMILinux: ami-0f2176987ee50226e
    AMILinux2: ami-082b5a644766e0e6f

⚠️ Please, pay attention

  • You may not specify a region, in this case, it will use default one which is us-east-1. Therefore you need to specify AMI ID of image from us-east-1.
  • By default utility creates output using yaml format. If you want to change it to json, then run the utility with --json flag.
cfn-ami-to-mapping --image-id ami-02f706d959cedf892 --top-level-key AMIID --us-east-2 --json

And the output:

{
    "AMIRegionMap": {
        "ap-northeast-1": {
            "AMILinux": "ami-04b2d1589ab1d972c"
        },
        "ap-northeast-2": {
            "AMILinux": "ami-0be3e6f84d3b968cd"
        },
        "ap-south-1": {
            "AMILinux": "ami-0b99c7725b9484f9e"
        },
        "ap-southeast-1": {
            "AMILinux": "ami-0fb6b6f9e81056553"
        },
        "ap-southeast-2": {
            "AMILinux": "ami-075caa3491def750b"
        },
        "ca-central-1": {
            "AMILinux": "ami-0a67d15f2858e33cb"
        },
        "eu-central-1": {
            "AMILinux": "ami-026d3b3672c6e7b66"
        },
        "eu-north-1": {
            "AMILinux": "ami-8c169ef2"
        },
        "eu-west-1": {
            "AMILinux": "ami-0862aabda3fb488b5"
        },
        "eu-west-2": {
            "AMILinux": "ami-0bdfa1adc3878cd23"
        },
        "eu-west-3": {
            "AMILinux": "ami-05b93cd5a1b552734"
        },
        "sa-east-1": {
            "AMILinux": "ami-0bb96001cf2299257"
        },
        "us-east-1": {
            "AMILinux": "ami-035b3c7efe6d061d5"
        },
        "us-east-2": {
            "AMILinux": "ami-02f706d959cedf892"
        },
        "us-west-1": {
            "AMILinux": "ami-0fcdcdb074d2bac5f"
        },
        "us-west-2": {
            "AMILinux": "ami-0f2176987ee50226e"
        }
    }
}

⚠️ It doesn't work perfectly, so please report Issues if you faced with any problem during the installation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].