Skip to main content

Command-line tools to manage images in AWS EC2

Project description

Build Status

ec2imgutils

A collection of utilities for image management in AWS EC2

Installation

openSUSE and SUSE Linux Enterprise

> zypper in python3-ec2imgutils

PyPI

> pip install ec2imgutils

Utilities

ec2deprecateimg

A command line utility to deprecate images in Amazon EC2. The platform does not support a formal deprecation mechanism. The mechansim implemented by this tool is a convention. Unfortunately the tags are not sticky, i.e. not visible to others if the image is shared.

Images are tagged with:

  • Deprecated on -> today's date in YYYYMMDD format
  • Removal date -> today's date plus the deprecation period specified
  • Replacement image -> The AMI ID and name of the replacement image

The image set as the replacement is removed from the list of potential images to be deprecated before any matching takes place. Therefore, the deprecation search criteria specified with --image-name-frag or --image-name-match cannot match the replacement image.

Usage

> ec2deprecateimg --account example --image-name-match v15 --image-virt-type hvm --replacement-name exampleimage_v16

See the man pages for more information.

man ec2deprecateimg

ec2listimg

A command line utility to list the AMIs in an account.

Usage

> ec2listimg --account example --image-name-frag foo --region us-west-2

See the man pages for more information.

man ec2listimg

ec2publishimg

A command line utility to control the visibility of an image in AWS EC2. The utility sets the visibility of an AMI to allow others to use the image, making it public or sharing it with sepecific accounts, or setting the image to private, i.e. only available to the account owner.

Usage

> ec2publishimg --account example --image-name-match production-v2 --share-with all

See the man pages for more information.

man ec2publishimg

ec2removeimg

A command line utility to remove images in Amazon EC2. Removing an image, in the sense that all traces of a given image are gone, means the image (AMI) has to be deregistered and the associated snapshot has to be deleted. Having to do this in multiple regions in the UI is tedious and from the the command line is a bookkeeping annoyance. This tool handles the clean up of images.

Usage

> ec2removeimg --account example --image-name-match v15

See the man pages for more information.

man ec2removeimg

ec2uploadimg

A command line utility to upload a compressed raw image file, as created by KIWI for example to Amazon EC2 and create a snapshot or register an EBS backed AMI. Uploads a compressed raw image to Amazon EC2 using an existing EC2 AMI and creates a snapshot or registers a new AMI from the image. The apparent size of the raw image is recommended to be 10 GB or less. It is expected that the raw image has 1 partition, i.e. the root partition is /dev/sda1. The process of creating the image is as follows:

  • Start an instance
  • Create a storage volume and attach it to the running instance
  • Create volume that will be the new root and attach it to the running instance
  • Upload the image
  • Unpack the image and dump it to the new root volume
  • Detach the new root volume and create a snapshot
  • Register a new AMI
  • Clean up

Usage

> ec2uploadimg --account example -d "My first image" -m x86_64 -n my_linux_image -r us-east-1 PATH_TO_COMPRESSED_FILE

See the man pages for more information.

man ec2uploadimg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ec2imgutils-9.0.2.tar.gz (51.4 kB view details)

Uploaded Source

Built Distribution

ec2imgutils-9.0.2-py3-none-any.whl (54.9 kB view details)

Uploaded Python 3

File details

Details for the file ec2imgutils-9.0.2.tar.gz.

File metadata

  • Download URL: ec2imgutils-9.0.2.tar.gz
  • Upload date:
  • Size: 51.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for ec2imgutils-9.0.2.tar.gz
Algorithm Hash digest
SHA256 93b6febd8d0f1c8f39148345cc3ea4e4f878bc6df70243da2f9224602d0dd178
MD5 78380d2ae71d06b8acaaace4f46db802
BLAKE2b-256 37d9158d16e4206a57d4286a1b600dd31f6d84f88cb06af8a331df8671ac7a8f

See more details on using hashes here.

File details

Details for the file ec2imgutils-9.0.2-py3-none-any.whl.

File metadata

  • Download URL: ec2imgutils-9.0.2-py3-none-any.whl
  • Upload date:
  • Size: 54.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for ec2imgutils-9.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e4bc1f37fc4c29291bf9267534b33d966c080120a3f992b63c567986d547a16b
MD5 fd90219464f05357529b56e781551351
BLAKE2b-256 8c7ac9796080a0fd6dbe3da576c864cce35eadb4dde7982fdd1222387e76bbf4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page