Giter VIP home page Giter VIP logo

aws_ami_list_retriever's Introduction

aws_ami_retriever

Tool to help generate all AMI's by owner on every region

Prerequisites

  • AWS Cli
  • AWS Access Keys
  • AWS EC2 Permissions

Commands

  1. Create a list of all the providers you want your tool to list AMIs for.
$ cat trusted_image_owners.log
CoreOS = "595879546273"
RHEL = "309956199498"
Centos = "679593333241"
  1. Configure your AWS CLI
$ aws configure
AWS Access Key ID [****************7GFC]:
AWS Secret Access Key [****************IBAi]:
Default region name [None]: us-west-2
  1. Retrieve all AMIs for each region by the trusted creators of the AMI below:
OWNERLIST=$(for owner in $(cat trusted_image_owners.log | awk '{print $3}'); do echo "--owner $owner";done | xargs); for region in $(aws ec2 describe-regions | grep RegionName | awk '{print $2}'); do aws ec2 describe-images --filters Name=virtualization-type,Values=hvm --region ${region//\"} $OWNERLIST > describe-images.${region//\"}.log; done
  1. Return the OS by description shared across a specific version of OS you want to retrieve. In my case, I want to retrieve a OS named RHEL-7.4_HVM-20180103-x86_64-2-Hourly2-GP2 from this list of images. Inspect the images that you want to retrieve yourself and query it.
for region in $(aws ec2 describe-regions | grep RegionName | awk '{print $2}'); do echo -n "rhel_7.4_${region//\"} = "; jq '.Images[] | select(.Name =="RHEL-7.4_HVM-20180103-x86_64-2-Hourly2-GP2") | .ImageId' describe-images.${region//\"}.log; done
  1. Output
rhel_7.4_eu-north-1 = rhel_7.4_ap-south-1 = "ami-e60e5a89"
rhel_7.4_eu-west-3 = "ami-dc13a4a1"
rhel_7.4_eu-west-2 = "ami-c1d2caa5"
rhel_7.4_eu-west-1 = "ami-c90195b0"
rhel_7.4_ap-northeast-2 = "ami-26f75748"
rhel_7.4_ap-northeast-1 = "ami-eb50cd8d"
rhel_7.4_sa-east-1 = "ami-0e88cb62"
rhel_7.4_ca-central-1 = "ami-c1cb4ea5"
rhel_7.4_ap-southeast-1 = "ami-5ae89f26"
rhel_7.4_ap-southeast-2 = "ami-1987757b"
rhel_7.4_eu-central-1 = "ami-194cdc76"
rhel_7.4_us-east-1 = "ami-26ebbc5c"
rhel_7.4_us-east-2 = "ami-0b1e356e"
rhel_7.4_us-west-1 = "ami-77a2a317"
rhel_7.4_us-west-2 = "ami-223f945a"

Uses

This repo is meant for simply back of the hand request as a workaround to retrieving all AMIs by a region.

aws_ami_list_retriever's People

Contributors

bernadinm avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.