Amazon EC2 AMI Tools

items>Amazon EC2 AMI Tools
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

The Amazon EC2 AMI Tools are command-line utilities to bundle an Amazon Machine Image (AMI), create an AMI from an existing machine or installed volume, and upload a bundled AMI to Amazon S3.


Submitted By: Max@AWS
AWS Products Used: Other
Languages(s): Other
Created On: August 25, 2006 7:56 PM GMT
Last Updated: April 16, 2015 10:14 PM GMT


Download the latest Amazon EC2 AMI Tools from Amazon S3:

The Amazon EC2 AMI Tools are available in the Amazon Linux AMI repositories as the aws-amitools-ec2 package.


Version 1.5.7

  • ec2-upload-bundle adds STS credentials to sigv4-style request headers.

Version 1.5.6

Version 1.5.5

  • Be more compatible with various versions of Ruby (1.8, 1.9, and 2.0).

Version 1.5.4

  • Ensure that the filesystem features of newly created AMIs more closely match the features of the root filesystem that they were created from. This fixes a bug with the tools that prevented a rebundled 2014.09 Amazon Linux AMI from booting.

Version 1.5.3

  • Fixed ec2-upload-bundle behavior when the upload bucket doesn't exist.
  • ec2-upload-bundle now works with S3 buckets that contain dots '.'
  • Removed dependency on 'which' shell builtin.

Version 1.5.2

  • We have added support for the China (Beijing) region.
  • We have added support for rebundling partitioned images. MBR/GPT partitioned AMIs may now be rebundled, which means that supported instance-store HVM AMIs may now be rebundled.
  • Users can now execute an arbitrary script via the --script flag. This script is executed after image cloning has been completed. An example use case would be a complex find command used to remove specific files from the cloned image before bundling begins.
  • For example, if we had a bash script named with the following contents:

    find "${mnt_dir}" -type f -name "*.priv" -exec rm -f {} \;
    We could use it like this:

    sudo ec2-bundle-vol -arch x86_64 --user XXXXXXXXXXXX --cert cert.pem --privatekey pk.pem --script /home/ec2-user/

  • The EC2 AMI Tools should run as expected on systems with either Ruby 1.8, Ruby 1.9, or Ruby 2.0.
  • Fixed bugs with --include and --exclude wildcard behavior. For example, sudo ec2-bundle-vol --arch x86_64 --user XXXXXXXXXXXX --cert cert.pem --privatekey pk.pem --exclude /root/.ssh,/home/ec2-user/.ssh --include "/home/ec2-user/files/*.pem"
  • We have added a --clone-only flag to ec2-bundle-vol. This allows users to stop the bundling procedure right after a copy of the user-specified volume has been created, and is useful for debugging if an image isn't bundling properly.
  • We have added --grub-config to ec2-bundle-vol. This enables specifying a specific grub configuration file to use during bundling, and is an alternative to directly editing the instance's grub configuration. At this time, only legacy grub(0.97) configuration files are supported.
  • This version of the tools has been used to successfully re-bundle Amazon Linux AMI 2013.03 & 2013.09, Ubuntu 12.04 LTS, CentOS 6.4, SLES 11 SP3, and RHEL 6.4 (with SELinux disabled).

Known Issues

  • When rebundling EBS-backed HVM AMIs as instance-store, use --block-device-mapping ami=sda,root=/dev/sda1,ephemeral0=sdb,ephemeral1=sdc,ephemeral2=sdd,ephemeral3=sde
  • The EC2 AMI Tools will fail to generate a bootable image on systems that have SELinux enabled, due to permission errors at boot time. SELinux will need to be disabled before the bundling process begins, and a reboot will be required.

Questions or Issues?

Please review the AMI Creation Guide or post a message to the EC2 Forum, and we will be happy to assist.

License Notice

Copyright 2008, Inc. or its affiliates. All Rights Reserved. All of the code, software libraries, applications, updates, tools, and other information and materials made available for download from this web page ("Software") are licensed under the Amazon Software License (the "License"). You may not use the Software except in compliance with the License. A copy of the License is located at or in the "license" file accompanying the Software. The Software 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.
©2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.