Create Images

Create images (AMI) of EC2 instances.

Source codePermissions

reboot ensures that all buffered data and data in memory is written to the volumes before the snapshots are created.
If reboot is not specified, underlying snapshots only contain the data that has been written to the volumes. Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots.

reboot can cause service interruptions. Handle with caution in production and outside maintenance windows.

Usage

Input

Parameter Description Type Required Default Value
instance_ids Instance IDs to create images for list(string) Yes None
reboot Reboot instances before creating the images bool No False
region Region for operation. Leave blank for session default string No Session Default
debug Increase log verbosity bool No False
silent Decrease log verbosity bool No False
output Output format
table
string No None
session Established session object No None

Output

Returns a list of image IDs created:

['ami-1234567890abcdef0', 'ami-abcdef1234567890']

Examples

Create images of instances without reboot:

aaws ec2 create_images --instance_ids i-1234567890abcdef0 i-abcdef1234567890

Create images of instances with reboot:

aaws ec2 create_images --instance_ids i-1234567890abcdef0 i-abcdef1234567890 --reboot