findami

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

findami

search ami with config file.

search ami for 'Amazon Linux 2022'

.findami.yml

AMIFilters:
  - Name: architecture
    Values: x86_64
  - Name: block-device-mapping.volume-type
    Values: gp3
  - Name: owner-alias
    Values: amazon
  - Name: is-public
    Values: "true"
  - Name: virtualization-type
    Values: hvm
  - Name: root-device-type
    Values: ebs
  - Name: sriov-net-support
    Values: simple
  - Name: ena-support
    Values: "true"
  - Name: state
    Values: available
  - Name: name
    Values: "*al2022*"
$ findami 
ami-0b6355270fae3a72e   Linux/UNIX   x86_64   gp3   al2022-ami-2022.0.20211118.0-kernel-5.10-x86_64
ami-0e357443256755720   Linux/UNIX   x86_64   gp3   al2022-ami-minimal-2022.0.20211118.0-kernel-5.10-x86_64

how to set filters

install

go install github.com/hacker65536/findami@latest

This way same as aws ec2 describe-images --image-id ami-0b6355270fae3a72e

$ findami -v ami-0b6355270fae3a72e | jq .
{
  "Images": [
    {
      "Architecture": "x86_64",
      "BlockDeviceMappings": [
        {
          "DeviceName": "/dev/xvda",
          "Ebs": {
            "DeleteOnTermination": true,
            "Encrypted": false,
            "Iops": null,
            "KmsKeyId": null,
            "OutpostArn": null,
            "SnapshotId": "snap-0f4d9678f534201ea",
            "Throughput": 125,
            "VolumeSize": 8,
            "VolumeType": "gp3"
          },
          "NoDevice": null,
          "VirtualName": null
        }
      ],
      "BootMode": "",
      "CreationDate": "2021-11-19T01:49:55.000Z",
      "DeprecationTime": null,
      "Description": "Amazon Linux 2022 AMI 2022.0.20211118.0 x86_64 HVM kernel-5.10",
      "EnaSupport": true,
      "Hypervisor": "xen",
      "ImageId": "ami-0b6355270fae3a72e",
      "ImageLocation": "amazon/al2022-ami-2022.0.20211118.0-kernel-5.10-x86_64",
      "ImageOwnerAlias": "amazon",
      "ImageType": "machine",
      "KernelId": null,
      "Name": "al2022-ami-2022.0.20211118.0-kernel-5.10-x86_64",
      "OwnerId": "137112412989",
      "Platform": "",
      "PlatformDetails": "Linux/UNIX",
      "ProductCodes": null,
      "Public": true,
      "RamdiskId": null,
      "RootDeviceName": "/dev/xvda",
      "RootDeviceType": "ebs",
      "SriovNetSupport": "simple",
      "State": "available",
      "StateReason": null,
      "Tags": null,
      "UsageOperation": "RunInstances",
      "VirtualizationType": "hvm"
    }
  ],
  "ResultMetadata": {}
}
ubuntu

https://ubuntu.com/server/docs/cloud-images/amazon-ec2

owner-id: 679593333241

centos

https://wiki.centos.org/Cloud/AWS

centos8 product-code: 47k9ia2igxpcce2bzo8u3kj03
centos7 product-code: cvugziknvmxgqna9noibqnnsy
centos6 product-code: ckx0h8ljio731afm2k92jtg62

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL