images
Creates, updates, deletes, gets or lists an images resource.
Overview
| Name | images |
| Type | Resource |
| Id | aws.ec2.images |
Fields
The following fields are returned by SELECT queries:
- describe_images
| Name | Datatype | Description |
|---|---|---|
architecture | string | The architecture of the image. |
block_device_mappings | string | Any block device mapping entries. |
boot_mode | string | The boot mode of the image. For more information, see Instance launch behavior with Amazon EC2 boot modes in the Amazon EC2 User Guide. |
creation_date | string | The date and time the image was created. |
deprecation_time | string | The date and time to deprecate the AMI, in UTC, in the following format: YYYY-MM-DDTHH:MM:SSZ. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute. |
deregistration_protection | string | Indicates whether deregistration protection is enabled for the AMI. |
description | string | The description of the AMI that was provided during image creation. |
ena_support | boolean | Specifies whether enhanced networking with ENA is enabled. |
free_tier_eligible | boolean | Indicates whether the image is eligible for Amazon Web Services Free Tier. If true, the AMI is eligible for Free Tier and can be used to launch instances under the Free Tier limits. If false, the AMI is not eligible for Free Tier. |
hypervisor | string | The hypervisor type of the image. Only xen is supported. ovm is not supported. |
image_allowed | boolean | If true, the AMI satisfies the criteria for Allowed AMIs and can be discovered and used in the account. If false and Allowed AMIs is set to enabled, the AMI can't be discovered or used in the account. If false and Allowed AMIs is set to audit-mode, the AMI can be discovered and used in the account. For more information, see Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs in Amazon EC2 User Guide. |
image_id | string | The ID of the AMI. |
image_location | string | The location of the AMI. |
image_owner_alias | string | The owner alias (amazon | aws-backup-vault | aws-marketplace). |
image_type | string | The type of image. |
image_watermarks | string | The watermarks attached to the AMI. |
imds_support | string | If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide. |
kernel_id | string | The kernel associated with the image, if any. Only applicable for machine images. |
last_launched_time | string | The date and time, in ISO 8601 date-time format, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported. lastLaunchedTime data is available starting April 2017. |
name | string | The name of the AMI that was provided during image creation. |
owner_id | string | The ID of the Amazon Web Services account that owns the image. |
platform | string | This value is set to windows for Windows AMIs; otherwise, it is blank. |
platform_details | string | The platform details associated with the billing code of the AMI. For more information, see Understand AMI billing information in the Amazon EC2 User Guide. |
product_codes | string | Any product codes associated with the AMI. |
public | boolean | Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions. |
public_ssm_parameter_name | string | The name of the public Systems Manager parameter that resolves to this AMI, under the aws/service/ namespace. |
ramdisk_id | string | The RAM disk associated with the image, if any. Only applicable for machine images. |
root_device_name | string | The device name of the root device volume (for example, /dev/sda1). |
root_device_type | string | The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume. |
source_image_id | string | The ID of the source AMI from which the AMI was created. |
source_image_region | string | The Region of the source AMI. |
source_instance_id | string | The ID of the instance that the AMI was created from if the AMI was created using CreateImage. This field only appears if the AMI was created using CreateImage. |
sriov_net_support | string | Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled. |
state | string | The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance. |
state_reason | string | The reason for the state change. |
tags | string | Any tags assigned to the image. |
tpm_support | string | If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide. |
usage_operation | string | The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. usageOperation corresponds to the lineitem/Operation column on your Amazon Web Services Cost and Usage Report and in the Amazon Web Services Price List API. You can view these fields on the Instances or AMIs pages in the Amazon EC2 console, or in the responses that are returned by the DescribeImages command in the Amazon EC2 API, or the describe-images command in the CLI. |
virtualization_type | string | The type of virtualization of the AMI. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_images | select | region | ExecutableBy, ImageId, Owner, IncludeDeprecated, IncludeDisabled, MaxResults, NextToken, DryRun, Filter | Describes the specified images (AMIs, AKIs, and ARIs) available to you or all of the images available to you. The images available to you include public images, private images that you own, and private images owned by other Amazon Web Services accounts for which you have explicit launch permissions. Recently deregistered images appear in the returned results for a short interval and then return empty results. After all instances that reference a deregistered AMI are terminated, specifying the ID of the image will eventually return an error indicating that the AMI ID cannot be found. When Allowed AMIs is set to enabled, only allowed images are returned in the results, with the imageAllowed field set to true for each image. In audit-mode, the imageAllowed field is set to true for images that meet the account's Allowed AMIs criteria, and false for images that don't meet the criteria. For more information, see Allowed AMIs. The Amazon EC2 API follows an eventual consistency model. This means that the result of an API command you run that creates or modifies resources might not be immediately available to all subsequent commands you run. For guidance on how to manage eventual consistency, see Eventual consistency in the Amazon EC2 API in the Amazon EC2 Developer Guide. We strongly recommend using only paginated requests. Unpaginated requests are susceptible to throttling and timeouts. The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order. |
create_image | insert | InstanceId, region | TagSpecification, SnapshotLocation, DryRun, Name, Description, NoReboot, BlockDeviceMapping | Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped. If you customized your instance with instance store volumes or Amazon EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes. The location of the source instance determines where you can create the snapshots of the AMI: If the source instance is in a Region, you must create the snapshots in the same Region as the instance. If the source instance is in a Local Zone, you can create the snapshots in the same Local Zone or in its parent Region. If the source instance is on an Outpost that supports local snapshots, you can create the snapshots on the same Outpost or in the parent Region of that Outpost. In this case, you must use the SnapshotLocation parameter to specify where to create the snapshots. For more information, see Create an Amazon EBS-backed AMI in the Amazon Elastic Compute Cloud User Guide. |
register_image | insert | region | ImageLocation, BillingProduct, BootMode, TpmSupport, UefiData, ImdsSupport, TagSpecification, DryRun, Name, Description, Architecture, KernelId, RamdiskId, RootDeviceName, BlockDeviceMapping, VirtualizationType, SriovNetSupport, EnaSupport | Registers an AMI. When you're creating an instance-store backed AMI, registering the AMI is the final step in the creation process. For more information about creating AMIs, see Create an AMI from a snapshot and Create an instance-store backed AMI in the Amazon EC2 User Guide. If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image. Register a snapshot of a root device volume You can use RegisterImage to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume. You specify the snapshot using a block device mapping. You can't set the encryption state of the volume using the block device mapping. If the snapshot is encrypted, or encryption by default is enabled, the root volume of an instance launched from the AMI is encrypted. For more information, see Create an AMI from a snapshot and Use encryption with EBS-backed AMIs in the Amazon EC2 User Guide. Amazon Web Services Marketplace product codes If any snapshots have Amazon Web Services Marketplace product codes, they are copied to the new AMI. In most cases, AMIs for Windows, RedHat, SUSE, and SQL Server require correct licensing information to be present on the AMI. For more information, see Understand AMI billing information in the Amazon EC2 User Guide. When creating an AMI from a snapshot, the RegisterImage operation derives the correct billing information from the snapshot's metadata, but this requires the appropriate metadata to be present. To verify if the correct billing information was applied, check the PlatformDetails field on the new AMI. If the field is empty or doesn't match the expected operating system code (for example, Windows, RedHat, SUSE, or SQL), the AMI creation was unsuccessful, and you should discard the AMI and instead create the AMI from an instance. For more information, see Create an AMI from an instance in the Amazon EC2 User Guide. If you purchase a Reserved Instance to apply to an On-Demand Instance that was launched from an AMI with a billing product code, make sure that the Reserved Instance has the matching billing product code. If you purchase a Reserved Instance without the matching billing product code, the Reserved Instance is not applied to the On-Demand Instance. For information about how to obtain the platform details and billing information of an AMI, see Understand AMI billing information in the Amazon EC2 User Guide. |
attach_image_watermark | update | ImageId, WatermarkName, region | DryRun | Attaches a watermark to a non-public AMI. The watermark is a structured identifier that automatically propagates to all derivative images created through CreateImage, and CopyImage. Only the AMI owner can attach watermarks. Watermarks cannot be added to public AMIs. |
detach_image_watermark | update | ImageId, WatermarkKey, region | DryRun | Removes a watermark from the specified AMI. This is an idempotent operation. It succeeds even if the watermark does not exist on the image. Removing a watermark from an image does not affect derivative images that already carry the watermark. Only the AMI owner can detach watermarks. |
deregister_image | delete | ImageId, region | DeleteAssociatedSnapshots, DryRun | Deregisters the specified AMI. A deregistered AMI can't be used to launch new instances. If a deregistered EBS-backed AMI matches a Recycle Bin retention rule, it moves to the Recycle Bin for the specified retention period. It can be restored before its retention period expires, after which it is permanently deleted. If the deregistered AMI doesn't match a retention rule, it is permanently deleted immediately. For more information, see Recover deleted Amazon EBS snapshots and EBS-backed AMIs with Recycle Bin in the Amazon EBS User Guide. When deregistering an EBS-backed AMI, you can optionally delete its associated snapshots at the same time. However, if a snapshot is associated with multiple AMIs, it won't be deleted even if specified for deletion, although the AMI will still be deregistered. Deregistering an AMI does not delete the following: Instances already launched from the AMI. You'll continue to incur usage costs for the instances until you terminate them. For EBS-backed AMIs: Snapshots that are associated with multiple AMIs. You'll continue to incur snapshot storage costs. For instance store-backed AMIs: The files uploaded to Amazon S3 during AMI creation. You'll continue to incur S3 storage costs. For more information, see Deregister an Amazon EC2 AMI in the Amazon EC2 User Guide. |
cancel_image_launch_permission | exec | ImageId, region | DryRun | Removes your Amazon Web Services account from the launch permissions for the specified AMI. For more information, see Cancel having an AMI shared with your Amazon Web Services account in the Amazon EC2 User Guide. |
disable_fast_launch | exec | ImageId, region | Force, DryRun | Discontinue Windows fast launch for a Windows AMI, and clean up existing pre-provisioned snapshots. After you disable Windows fast launch, the AMI uses the standard launch process for each new instance. Amazon EC2 must remove all pre-provisioned snapshots before you can enable Windows fast launch again. You can only change these settings for Windows AMIs that you own or that have been shared with you. |
disable_image_block_public_access | exec | region | DryRun | Disables block public access for AMIs at the account level in the specified Amazon Web Services Region. This removes the block public access restriction from your account. With the restriction removed, you can publicly share your AMIs in the specified Amazon Web Services Region. For more information, see Block public access to your AMIs in the Amazon EC2 User Guide. |
disable_image_deprecation | exec | ImageId, region | DryRun | Cancels the deprecation of the specified AMI. For more information, see Deprecate an Amazon EC2 AMI in the Amazon EC2 User Guide. |
disable_image_deregistration_protection | exec | ImageId, region | DryRun | Disables deregistration protection for an AMI. When deregistration protection is disabled, the AMI can be deregistered. If you chose to include a 24-hour cooldown period when you enabled deregistration protection for the AMI, then, when you disable deregistration protection, you won’t immediately be able to deregister the AMI. For more information, see Protect an Amazon EC2 AMI from deregistration in the Amazon EC2 User Guide. |
enable_fast_launch | exec | ImageId, region | ResourceType, SnapshotConfiguration, LaunchTemplate, MaxParallelLaunches, DryRun | When you enable Windows fast launch for a Windows AMI, images are pre-provisioned, using snapshots to launch instances up to 65% faster. To create the optimized Windows image, Amazon EC2 launches an instance and runs through Sysprep steps, rebooting as required. Then it creates a set of reserved snapshots that are used for subsequent launches. The reserved snapshots are automatically replenished as they are used, depending on your settings for launch frequency. You can only change these settings for Windows AMIs that you own or that have been shared with you. |
enable_image_block_public_access | exec | ImageBlockPublicAccessState, region | DryRun | Enables block public access for AMIs at the account level in the specified Amazon Web Services Region. This prevents the public sharing of your AMIs. However, if you already have public AMIs, they will remain publicly available. The API can take up to 10 minutes to configure this setting. During this time, if you run GetImageBlockPublicAccessState, the response will be unblocked. When the API has completed the configuration, the response will be block-new-sharing. For more information, see Block public access to your AMIs in the Amazon EC2 User Guide. |
enable_image_deprecation | exec | ImageId, DeprecateAt, region | DryRun | Enables deprecation of the specified AMI at the specified date and time. For more information, see Deprecate an AMI in the Amazon EC2 User Guide. |
enable_image_deregistration_protection | exec | ImageId, region | WithCooldown, DryRun | Enables deregistration protection for an AMI. When deregistration protection is enabled, the AMI can't be deregistered. To allow the AMI to be deregistered, you must first disable deregistration protection. For more information, see Protect an Amazon EC2 AMI from deregistration in the Amazon EC2 User Guide. |
reset_image_attribute | exec | Attribute, ImageId, region | DryRun | Resets an attribute of an AMI to its default value. |
restore_image_from_recycle_bin | exec | ImageId, region | DryRun | Restores an AMI from the Recycle Bin. For more information, see Recover deleted Amazon EBS snapshots and EBS-back AMIs with Recycle Bin in the Amazon EC2 User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
Attribute | string | The attribute to reset (currently you can only reset the launch permission attribute). |
DeprecateAt | string (date-time) | The date and time to deprecate the AMI, in UTC, in the following format: YYYY-MM-DDTHH:MM:SSZ. If you specify a value for seconds, Amazon EC2 rounds the seconds to the nearest minute. You can’t specify a date in the past. The upper limit for DeprecateAt is 10 years from now, except for public AMIs, where the upper limit is 2 years from the creation date. |
ImageBlockPublicAccessState | string | Specify block-new-sharing to enable block public access for AMIs at the account level in the specified Region. This will block any attempt to publicly share your AMIs in the specified Region. |
ImageId | string | The ID of the AMI to restore. |
InstanceId | string | The ID of the instance. |
WatermarkKey | string | The watermark key to remove, in accountId:watermarkName format (for example, 123456789012:approvedAmi). |
WatermarkName | string | The name for the watermark. Combined with the caller's account ID to form the WatermarkKey (accountId:watermarkName). Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_) |
region | string | AWS region (default: us-east-1) |
Architecture | string | The architecture of the AMI. Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file. |
BillingProduct | array | The billing product codes. Your account must be authorized to specify billing product codes. If your account is not authorized to specify billing product codes, you can publish AMIs that include billable software and list them on the Amazon Web Services Marketplace. You must first register as a seller on the Amazon Web Services Marketplace. For more information, see Getting started as an Amazon Web Services Marketplace seller and AMI-based products in Amazon Web Services Marketplace in the Amazon Web Services Marketplace Seller Guide. |
BlockDeviceMapping | array | The block device mapping entries. If you specify an Amazon EBS volume using the ID of an Amazon EBS snapshot, you can't specify the encryption state of the volume. If you create an AMI on an Outpost, then all backing snapshots must be on the same Outpost or in the Region of that Outpost. AMIs on an Outpost that include local snapshots can be used to launch instances on the same Outpost only. For more information, Create AMIs from local snapshots in the Amazon EBS User Guide. |
BootMode | string | The boot mode of the AMI. A value of uefi-preferred indicates that the AMI supports both UEFI and Legacy BIOS. The operating system contained in the AMI must be configured to support the specified boot mode. For more information, see Instance launch behavior with Amazon EC2 boot modes in the Amazon EC2 User Guide. |
DeleteAssociatedSnapshots | boolean | Specifies whether to delete the snapshots associated with the AMI during deregistration. If a snapshot is associated with multiple AMIs, it is not deleted, regardless of this setting. Default: The snapshots are not deleted. |
Description | string | A description for your AMI. |
DryRun | boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
EnaSupport | boolean | Set to true to enable enhanced networking with ENA for the AMI and any instances that you launch from the AMI. This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable. |
ExecutableBy | array | Scopes the images by users with explicit launch permissions. Specify an Amazon Web Services account ID, self (the sender of the request), or all (public AMIs). If you specify an Amazon Web Services account ID that is not your own, only AMIs shared with that specific Amazon Web Services account ID are returned. However, AMIs that are shared with the account’s organization or organizational unit (OU) are not returned. If you specify self or your own Amazon Web Services account ID, AMIs shared with your account are returned. In addition, AMIs that are shared with the organization or OU of which you are member are also returned. If you specify all, all public AMIs are returned. |
Filter | array | The filters. architecture - The image architecture (i386 | x86_64 | arm64 | x86_64_mac | arm64_mac). block-device-mapping.delete-on-termination - A Boolean value that indicates whether the Amazon EBS volume is deleted on instance termination. block-device-mapping.device-name - The device name specified in the block device mapping (for example, /dev/sdh or xvdh). block-device-mapping.snapshot-id - The ID of the snapshot used for the Amazon EBS volume. block-device-mapping.volume-size - The volume size of the Amazon EBS volume, in GiB. block-device-mapping.volume-type - The volume type of the Amazon EBS volume (io1 | io2 | gp2 | gp3 | sc1 | st1 | standard). block-device-mapping.encrypted - A Boolean that indicates whether the Amazon EBS volume is encrypted. creation-date - The time when the image was created, in the ISO 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example, 2021-09-29T11:04:43.305Z. You can use a wildcard (), for example, 2021-09-29T, which matches an entire day. description - The description of the image (provided during image creation). ena-support - A Boolean that indicates whether enhanced networking with ENA is enabled. free-tier-eligible - A Boolean that indicates whether this image can be used under the Amazon Web Services Free Tier (true | false). hypervisor - The hypervisor type (ovm | xen). image-allowed - A Boolean that indicates whether the image meets the criteria specified for Allowed AMIs. image-id - The ID of the image. image-watermark.source-image-creation-time - The creation date of the source AMI, in the ISO 8601 format in the UTC time zone ( YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM ). You can use a wildcard (), for example, 2021-09-29T, which matches an entire day. image-watermark.source-image-id - The ID of the AMI to which the watermark was originally attached. image-watermark.source-image-region - The Region where the watermark was originally attached. image-watermark.watermark-creation-time - The date and time the watermark was attached to the AMI, in the ISO 8601 format in the UTC time zone ( YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM ). You can use a wildcard (), for example, 2021-09-29T, which matches an entire day. image-watermark.watermark-key - The watermark identifier, in accountId:watermarkName format (for example, 123456789012:approvedAmi). image-type - The image type (machine | kernel | ramdisk). is-public - A Boolean that indicates whether the image is public. kernel-id - The kernel ID. manifest-location - The location of the image manifest. name - The name of the AMI (provided during image creation). owner-alias - The owner alias (amazon | aws-backup-vault | aws-marketplace). The valid aliases are defined in an Amazon-maintained list. This is not the Amazon Web Services account alias that can be set using the IAM console. We recommend that you use the Owner request parameter instead of this filter. owner-id - The Amazon Web Services account ID of the owner. We recommend that you use the Owner request parameter instead of this filter. platform - The platform. The only supported value is windows. product-code - The product code. product-code.type - The type of the product code (marketplace). public-ssm-parameter-name - The name of a public Systems Manager parameter associated with the AMI. The parameter must be in a trusted Amazon Web Services namespace under aws/service/. Returns all AMIs that have ever been associated with the parameter, including previous versions. ramdisk-id - The RAM disk ID. root-device-name - The device name of the root device volume (for example, /dev/sda1). root-device-type - The type of the root device volume (ebs | instance-store). source-image-id - The ID of the source AMI from which the AMI was created. source-image-region - The Region of the source AMI. source-instance-id - The ID of the instance that the AMI was created from if the AMI was created using CreateImage. This filter is applicable only if the AMI was created using CreateImage. state - The state of the image (available | pending | failed). state-reason-code - The reason code for the state change. state-reason-message - The message for the state change. sriov-net-support - A value of simple indicates that enhanced networking with the Intel 82599 VF interface is enabled. tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value. virtualization-type - The virtualization type (paravirtual | hvm). |
Force | boolean | Forces the image settings to turn off Windows fast launch for your Windows AMI. This parameter overrides any errors that are encountered while cleaning up resources in your account. |
ImageId | array | The image IDs. Default: Describes all images available to you. |
ImageLocation | string | The full path to your AMI manifest in Amazon S3 storage. The specified bucket must have the aws-exec-read canned access control list (ACL) to ensure that it can be accessed by Amazon EC2. For more information, see Canned ACL in the Amazon S3 Service Developer Guide. |
ImdsSupport | string | Set to v2.0 to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide. If you set the value to v2.0, make sure that your AMI software can support IMDSv2. |
IncludeDeprecated | boolean | Specifies whether to include deprecated AMIs. Default: No deprecated AMIs are included in the response. If you are the AMI owner, all deprecated AMIs appear in the response regardless of what you specify for this parameter. |
IncludeDisabled | boolean | Specifies whether to include disabled AMIs. Default: No disabled AMIs are included in the response. |
KernelId | string | The ID of the kernel. |
LaunchTemplate | object | The launch template to use when launching Windows instances from pre-provisioned snapshots. Launch template parameters can include either the name or ID of the launch template, but not both. |
MaxParallelLaunches | integer | The maximum number of instances that Amazon EC2 can launch at the same time to create pre-provisioned snapshots for Windows fast launch. Value must be 6 or greater. |
MaxResults | integer | The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination. |
Name | string | A name for your AMI. Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_) |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
NoReboot | boolean | Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of the following values: true - The instance is not rebooted before creating the image. This creates crash-consistent snapshots that include only the data that has been written to the volumes at the time the snapshots are created. Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots. false - The instance is rebooted before creating the image. This ensures that all buffered data and data in memory is written to the volumes before the snapshots are created. Default: false |
Owner | array | Scopes the results to images with the specified owners. You can specify a combination of Amazon Web Services account IDs, self, amazon, aws-backup-vault, and aws-marketplace. If you omit this parameter, the results include all images for which you have launch permissions, regardless of ownership. |
RamdiskId | string | The ID of the RAM disk. |
ResourceType | string | The type of resource to use for pre-provisioning the AMI for Windows fast launch. Supported values include: snapshot, which is the default value. |
RootDeviceName | string | The device name of the root device volume (for example, /dev/sda1). |
SnapshotConfiguration | object | Configuration settings for creating and managing the snapshots that are used for pre-provisioning the AMI for Windows fast launch. The associated ResourceType must be snapshot. |
SnapshotLocation | string | Only supported for instances in Local Zones and for instances on Outposts that support local snapshots. If the source instance is not in one of these locations, omit this parameter. The Amazon S3 location where the snapshots will be stored. To create local snapshots in the same Local Zone or on the same Outpost as the source instance, specify local. To create regional snapshots in the parent Region of the Local Zone or Outpost, specify regional. If the source instance is in a Local Zone and you omit this parameter, regional snapshots are created in the parent Region of the Local Zone. If the source instance is on an Outpost that supports local snapshots, this parameter is required. If you omit it, the request fails with an InvalidParameterValue error. Default: regional (for instances in Local Zones only) |
SriovNetSupport | string | Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI. There is no way to disable sriovNetSupport at this time. This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable. |
TagSpecification | array | The tags to apply to the AMI. To tag the AMI, the value for ResourceType must be image. If you specify another value for ResourceType, the request fails. To tag an AMI after it has been registered, see CreateTags. |
TpmSupport | string | Set to v2.0 to enable Trusted Platform Module (TPM) support. For more information, see NitroTPM in the Amazon EC2 User Guide. |
UefiData | string | Base64 representation of the non-volatile UEFI variable store. To retrieve the UEFI data, use the GetInstanceUefiData command. You can inspect and modify the UEFI data by using the python-uefivars tool on GitHub. For more information, see UEFI Secure Boot for Amazon EC2 instances in the Amazon EC2 User Guide. |
VirtualizationType | string | The type of virtualization (hvm | paravirtual). Default: paravirtual |
WithCooldown | boolean | If true, enforces deregistration protection for 24 hours after deregistration protection is disabled. |
SELECT examples
- describe_images
Describes the specified images (AMIs, AKIs, and ARIs) available to you or all of the images available to you. The images available to you include public images, private images that you own, and private images owned by other Amazon Web Services accounts for which you have explicit launch permissions. Recently deregistered images appear in the returned results for a short interval and then return empty results. After all instances that reference a deregistered AMI are terminated, specifying the ID of the image will eventually return an error indicating that the AMI ID cannot be found. When Allowed AMIs is set to enabled, only allowed images are returned in the results, with the imageAllowed field set to true for each image. In audit-mode, the imageAllowed field is set to true for images that meet the account's Allowed AMIs criteria, and false for images that don't meet the criteria. For more information, see Allowed AMIs. The Amazon EC2 API follows an eventual consistency model. This means that the result of an API command you run that creates or modifies resources might not be immediately available to all subsequent commands you run. For guidance on how to manage eventual consistency, see Eventual consistency in the Amazon EC2 API in the Amazon EC2 Developer Guide. We strongly recommend using only paginated requests. Unpaginated requests are susceptible to throttling and timeouts. The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.
SELECT
architecture,
block_device_mappings,
boot_mode,
creation_date,
deprecation_time,
deregistration_protection,
description,
ena_support,
free_tier_eligible,
hypervisor,
image_allowed,
image_id,
image_location,
image_owner_alias,
image_type,
image_watermarks,
imds_support,
kernel_id,
last_launched_time,
name,
owner_id,
platform,
platform_details,
product_codes,
public,
public_ssm_parameter_name,
ramdisk_id,
root_device_name,
root_device_type,
source_image_id,
source_image_region,
source_instance_id,
sriov_net_support,
state,
state_reason,
tags,
tpm_support,
usage_operation,
virtualization_type
FROM aws.ec2.images
WHERE region = '{{ region }}' -- required
AND ExecutableBy = '{{ ExecutableBy }}'
AND ImageId = '{{ ImageId }}'
AND Owner = '{{ Owner }}'
AND IncludeDeprecated = '{{ IncludeDeprecated }}'
AND IncludeDisabled = '{{ IncludeDisabled }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
;
INSERT examples
- create_image
- register_image
- Manifest
Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped. If you customized your instance with instance store volumes or Amazon EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes. The location of the source instance determines where you can create the snapshots of the AMI: If the source instance is in a Region, you must create the snapshots in the same Region as the instance. If the source instance is in a Local Zone, you can create the snapshots in the same Local Zone or in its parent Region. If the source instance is on an Outpost that supports local snapshots, you can create the snapshots on the same Outpost or in the parent Region of that Outpost. In this case, you must use the SnapshotLocation parameter to specify where to create the snapshots. For more information, see Create an Amazon EBS-backed AMI in the Amazon Elastic Compute Cloud User Guide.
INSERT INTO aws.ec2.images (
InstanceId,
region,
TagSpecification,
SnapshotLocation,
DryRun,
Name,
Description,
NoReboot,
BlockDeviceMapping
)
SELECT
'{{ InstanceId }}',
'{{ region }}',
'{{ TagSpecification }}',
'{{ SnapshotLocation }}',
'{{ DryRun }}',
'{{ Name }}',
'{{ Description }}',
'{{ NoReboot }}',
'{{ BlockDeviceMapping }}'
RETURNING
image_id
;
Registers an AMI. When you're creating an instance-store backed AMI, registering the AMI is the final step in the creation process. For more information about creating AMIs, see Create an AMI from a snapshot and Create an instance-store backed AMI in the Amazon EC2 User Guide. If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image. Register a snapshot of a root device volume You can use RegisterImage to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume. You specify the snapshot using a block device mapping. You can't set the encryption state of the volume using the block device mapping. If the snapshot is encrypted, or encryption by default is enabled, the root volume of an instance launched from the AMI is encrypted. For more information, see Create an AMI from a snapshot and Use encryption with EBS-backed AMIs in the Amazon EC2 User Guide. Amazon Web Services Marketplace product codes If any snapshots have Amazon Web Services Marketplace product codes, they are copied to the new AMI. In most cases, AMIs for Windows, RedHat, SUSE, and SQL Server require correct licensing information to be present on the AMI. For more information, see Understand AMI billing information in the Amazon EC2 User Guide. When creating an AMI from a snapshot, the RegisterImage operation derives the correct billing information from the snapshot's metadata, but this requires the appropriate metadata to be present. To verify if the correct billing information was applied, check the PlatformDetails field on the new AMI. If the field is empty or doesn't match the expected operating system code (for example, Windows, RedHat, SUSE, or SQL), the AMI creation was unsuccessful, and you should discard the AMI and instead create the AMI from an instance. For more information, see Create an AMI from an instance in the Amazon EC2 User Guide. If you purchase a Reserved Instance to apply to an On-Demand Instance that was launched from an AMI with a billing product code, make sure that the Reserved Instance has the matching billing product code. If you purchase a Reserved Instance without the matching billing product code, the Reserved Instance is not applied to the On-Demand Instance. For information about how to obtain the platform details and billing information of an AMI, see Understand AMI billing information in the Amazon EC2 User Guide.
INSERT INTO aws.ec2.images (
region,
ImageLocation,
BillingProduct,
BootMode,
TpmSupport,
UefiData,
ImdsSupport,
TagSpecification,
DryRun,
Name,
Description,
Architecture,
KernelId,
RamdiskId,
RootDeviceName,
BlockDeviceMapping,
VirtualizationType,
SriovNetSupport,
EnaSupport
)
SELECT
'{{ region }}',
'{{ ImageLocation }}',
'{{ BillingProduct }}',
'{{ BootMode }}',
'{{ TpmSupport }}',
'{{ UefiData }}',
'{{ ImdsSupport }}',
'{{ TagSpecification }}',
'{{ DryRun }}',
'{{ Name }}',
'{{ Description }}',
'{{ Architecture }}',
'{{ KernelId }}',
'{{ RamdiskId }}',
'{{ RootDeviceName }}',
'{{ BlockDeviceMapping }}',
'{{ VirtualizationType }}',
'{{ SriovNetSupport }}',
'{{ EnaSupport }}'
RETURNING
image_id
;
# Description fields are for documentation purposes
- name: images
props:
- name: InstanceId
value: "{{ InstanceId }}"
description: Required parameter for the images resource.
- name: region
value: "{{ region }}"
description: Required parameter for the images resource.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both. To tag the AMI, the value for ResourceType must be image. To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the instance, the value for ResourceType must be snapshot. The same tag is applied to all of the snapshots that are created. If you specify other values for ResourceType, the request fails. To tag an AMI or snapshot after it has been created, see CreateTags.
description: The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both. To tag the AMI, the value for ResourceType must be image. To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the instance, the value for ResourceType must be snapshot. The same tag is applied to all of the snapshots that are created. If you specify other values for ResourceType, the request fails. To tag an AMI or snapshot after it has been created, see CreateTags.
- name: SnapshotLocation
value: "{{ SnapshotLocation }}"
description: Only supported for instances in Local Zones and for instances on Outposts that support local snapshots. If the source instance is not in one of these locations, omit this parameter. The Amazon S3 location where the snapshots will be stored. To create local snapshots in the same Local Zone or on the same Outpost as the source instance, specify local. To create regional snapshots in the parent Region of the Local Zone or Outpost, specify regional. If the source instance is in a Local Zone and you omit this parameter, regional snapshots are created in the parent Region of the Local Zone. If the source instance is on an Outpost that supports local snapshots, this parameter is required. If you omit it, the request fails with an InvalidParameterValue error. Default: regional (for instances in Local Zones only)
description: Only supported for instances in Local Zones and for instances on Outposts that support local snapshots. If the source instance is not in one of these locations, omit this parameter. The Amazon S3 location where the snapshots will be stored. To create local snapshots in the same Local Zone or on the same Outpost as the source instance, specify local. To create regional snapshots in the parent Region of the Local Zone or Outpost, specify regional. If the source instance is in a Local Zone and you omit this parameter, regional snapshots are created in the parent Region of the Local Zone. If the source instance is on an Outpost that supports local snapshots, this parameter is required. If you omit it, the request fails with an InvalidParameterValue error. Default: regional (for instances in Local Zones only)
- name: DryRun
value: {{ DryRun }}
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
- name: Name
value: "{{ Name }}"
description: A name for the new image. Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
description: A name for the new image. Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
- name: Description
value: "{{ Description }}"
description: A description for the new image.
description: A description for the new image.
- name: NoReboot
value: {{ NoReboot }}
description: Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of the following values: true - The instance is not rebooted before creating the image. This creates crash-consistent snapshots that include only the data that has been written to the volumes at the time the snapshots are created. Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots. false - The instance is rebooted before creating the image. This ensures that all buffered data and data in memory is written to the volumes before the snapshots are created. Default: false
description: Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of the following values: true - The instance is not rebooted before creating the image. This creates crash-consistent snapshots that include only the data that has been written to the volumes at the time the snapshots are created. Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots. false - The instance is rebooted before creating the image. This ensures that all buffered data and data in memory is written to the volumes before the snapshots are created. Default: false
- name: BlockDeviceMapping
value: "{{ BlockDeviceMapping }}"
description: The block device mappings. When using the CreateImage action: You can't change the volume size using the VolumeSize parameter. If you want a different volume size, you must first change the volume size of the source instance. You can't modify the encryption status of existing volumes or snapshots. To create an AMI with volumes or snapshots that have a different encryption status (for example, where the source volume and snapshots are unencrypted, and you want to create an AMI with encrypted volumes or snapshots), copy the image instead. The only option that can be changed for existing mappings or snapshots is DeleteOnTermination.
description: The block device mappings. When using the CreateImage action: You can't change the volume size using the VolumeSize parameter. If you want a different volume size, you must first change the volume size of the source instance. You can't modify the encryption status of existing volumes or snapshots. To create an AMI with volumes or snapshots that have a different encryption status (for example, where the source volume and snapshots are unencrypted, and you want to create an AMI with encrypted volumes or snapshots), copy the image instead. The only option that can be changed for existing mappings or snapshots is DeleteOnTermination.
- name: ImageLocation
value: "{{ ImageLocation }}"
description: The full path to your AMI manifest in Amazon S3 storage. The specified bucket must have the aws-exec-read canned access control list (ACL) to ensure that it can be accessed by Amazon EC2. For more information, see Canned ACL in the Amazon S3 Service Developer Guide.
description: The full path to your AMI manifest in Amazon S3 storage. The specified bucket must have the aws-exec-read canned access control list (ACL) to ensure that it can be accessed by Amazon EC2. For more information, see Canned ACL in the Amazon S3 Service Developer Guide.
- name: BillingProduct
value: "{{ BillingProduct }}"
description: The billing product codes. Your account must be authorized to specify billing product codes. If your account is not authorized to specify billing product codes, you can publish AMIs that include billable software and list them on the Amazon Web Services Marketplace. You must first register as a seller on the Amazon Web Services Marketplace. For more information, see Getting started as an Amazon Web Services Marketplace seller and AMI-based products in Amazon Web Services Marketplace in the Amazon Web Services Marketplace Seller Guide.
description: The billing product codes. Your account must be authorized to specify billing product codes. If your account is not authorized to specify billing product codes, you can publish AMIs that include billable software and list them on the Amazon Web Services Marketplace. You must first register as a seller on the Amazon Web Services Marketplace. For more information, see Getting started as an Amazon Web Services Marketplace seller and AMI-based products in Amazon Web Services Marketplace in the Amazon Web Services Marketplace Seller Guide.
- name: BootMode
value: "{{ BootMode }}"
description: The boot mode of the AMI. A value of uefi-preferred indicates that the AMI supports both UEFI and Legacy BIOS. The operating system contained in the AMI must be configured to support the specified boot mode. For more information, see Instance launch behavior with Amazon EC2 boot modes in the Amazon EC2 User Guide.
description: The boot mode of the AMI. A value of uefi-preferred indicates that the AMI supports both UEFI and Legacy BIOS. The operating system contained in the AMI must be configured to support the specified boot mode. For more information, see Instance launch behavior with Amazon EC2 boot modes in the Amazon EC2 User Guide.
- name: TpmSupport
value: "{{ TpmSupport }}"
description: Set to v2.0 to enable Trusted Platform Module (TPM) support. For more information, see NitroTPM in the Amazon EC2 User Guide.
description: Set to v2.0 to enable Trusted Platform Module (TPM) support. For more information, see NitroTPM in the Amazon EC2 User Guide.
- name: UefiData
value: "{{ UefiData }}"
description: Base64 representation of the non-volatile UEFI variable store. To retrieve the UEFI data, use the GetInstanceUefiData command. You can inspect and modify the UEFI data by using the python-uefivars tool on GitHub. For more information, see UEFI Secure Boot for Amazon EC2 instances in the Amazon EC2 User Guide.
description: Base64 representation of the non-volatile UEFI variable store. To retrieve the UEFI data, use the GetInstanceUefiData command. You can inspect and modify the UEFI data by using the python-uefivars tool on GitHub. For more information, see UEFI Secure Boot for Amazon EC2 instances in the Amazon EC2 User Guide.
- name: ImdsSupport
value: "{{ ImdsSupport }}"
description: Set to v2.0 to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide. If you set the value to v2.0, make sure that your AMI software can support IMDSv2.
description: Set to v2.0 to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide. If you set the value to v2.0, make sure that your AMI software can support IMDSv2.
- name: Architecture
value: "{{ Architecture }}"
description: The architecture of the AMI. Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.
description: The architecture of the AMI. Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.
- name: KernelId
value: "{{ KernelId }}"
description: The ID of the kernel.
description: The ID of the kernel.
- name: RamdiskId
value: "{{ RamdiskId }}"
description: The ID of the RAM disk.
description: The ID of the RAM disk.
- name: RootDeviceName
value: "{{ RootDeviceName }}"
description: The device name of the root device volume (for example, /dev/sda1).
description: The device name of the root device volume (for example, /dev/sda1).
- name: VirtualizationType
value: "{{ VirtualizationType }}"
description: The type of virtualization (hvm | paravirtual). Default: paravirtual
description: The type of virtualization (hvm | paravirtual). Default: paravirtual
- name: SriovNetSupport
value: "{{ SriovNetSupport }}"
description: Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI. There is no way to disable sriovNetSupport at this time. This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
description: Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI. There is no way to disable sriovNetSupport at this time. This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
- name: EnaSupport
value: {{ EnaSupport }}
description: Set to true to enable enhanced networking with ENA for the AMI and any instances that you launch from the AMI. This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
description: Set to true to enable enhanced networking with ENA for the AMI and any instances that you launch from the AMI. This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
UPDATE examples
- attach_image_watermark
- detach_image_watermark
Attaches a watermark to a non-public AMI. The watermark is a structured identifier that automatically propagates to all derivative images created through CreateImage, and CopyImage. Only the AMI owner can attach watermarks. Watermarks cannot be added to public AMIs.
UPDATE aws.ec2.images
SET
-- No updatable properties
WHERE
ImageId = '{{ ImageId }}' --required
AND WatermarkName = '{{ WatermarkName }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
RETURNING
watermark_key;
Removes a watermark from the specified AMI. This is an idempotent operation. It succeeds even if the watermark does not exist on the image. Removing a watermark from an image does not affect derivative images that already carry the watermark. Only the AMI owner can detach watermarks.
UPDATE aws.ec2.images
SET
-- No updatable properties
WHERE
ImageId = '{{ ImageId }}' --required
AND WatermarkKey = '{{ WatermarkKey }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
RETURNING
return;
DELETE examples
- deregister_image
Deregisters the specified AMI. A deregistered AMI can't be used to launch new instances. If a deregistered EBS-backed AMI matches a Recycle Bin retention rule, it moves to the Recycle Bin for the specified retention period. It can be restored before its retention period expires, after which it is permanently deleted. If the deregistered AMI doesn't match a retention rule, it is permanently deleted immediately. For more information, see Recover deleted Amazon EBS snapshots and EBS-backed AMIs with Recycle Bin in the Amazon EBS User Guide. When deregistering an EBS-backed AMI, you can optionally delete its associated snapshots at the same time. However, if a snapshot is associated with multiple AMIs, it won't be deleted even if specified for deletion, although the AMI will still be deregistered. Deregistering an AMI does not delete the following: Instances already launched from the AMI. You'll continue to incur usage costs for the instances until you terminate them. For EBS-backed AMIs: Snapshots that are associated with multiple AMIs. You'll continue to incur snapshot storage costs. For instance store-backed AMIs: The files uploaded to Amazon S3 during AMI creation. You'll continue to incur S3 storage costs. For more information, see Deregister an Amazon EC2 AMI in the Amazon EC2 User Guide.
DELETE FROM aws.ec2.images
WHERE ImageId = '{{ ImageId }}' --required
AND region = '{{ region }}' --required
AND DeleteAssociatedSnapshots = '{{ DeleteAssociatedSnapshots }}'
AND DryRun = '{{ DryRun }}'
;
Lifecycle Methods
- cancel_image_launch_permission
- disable_fast_launch
- disable_image_block_public_access
- disable_image_deprecation
- disable_image_deregistration_protection
- enable_fast_launch
- enable_image_block_public_access
- enable_image_deprecation
- enable_image_deregistration_protection
- reset_image_attribute
- restore_image_from_recycle_bin
Removes your Amazon Web Services account from the launch permissions for the specified AMI. For more information, see Cancel having an AMI shared with your Amazon Web Services account in the Amazon EC2 User Guide.
EXEC aws.ec2.images.cancel_image_launch_permission
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;
Discontinue Windows fast launch for a Windows AMI, and clean up existing pre-provisioned snapshots. After you disable Windows fast launch, the AMI uses the standard launch process for each new instance. Amazon EC2 must remove all pre-provisioned snapshots before you can enable Windows fast launch again. You can only change these settings for Windows AMIs that you own or that have been shared with you.
EXEC aws.ec2.images.disable_fast_launch
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@Force={{ Force }},
@DryRun={{ DryRun }}
;
Disables block public access for AMIs at the account level in the specified Amazon Web Services Region. This removes the block public access restriction from your account. With the restriction removed, you can publicly share your AMIs in the specified Amazon Web Services Region. For more information, see Block public access to your AMIs in the Amazon EC2 User Guide.
EXEC aws.ec2.images.disable_image_block_public_access
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;
Cancels the deprecation of the specified AMI. For more information, see Deprecate an Amazon EC2 AMI in the Amazon EC2 User Guide.
EXEC aws.ec2.images.disable_image_deprecation
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;
Disables deregistration protection for an AMI. When deregistration protection is disabled, the AMI can be deregistered. If you chose to include a 24-hour cooldown period when you enabled deregistration protection for the AMI, then, when you disable deregistration protection, you won’t immediately be able to deregister the AMI. For more information, see Protect an Amazon EC2 AMI from deregistration in the Amazon EC2 User Guide.
EXEC aws.ec2.images.disable_image_deregistration_protection
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;
When you enable Windows fast launch for a Windows AMI, images are pre-provisioned, using snapshots to launch instances up to 65% faster. To create the optimized Windows image, Amazon EC2 launches an instance and runs through Sysprep steps, rebooting as required. Then it creates a set of reserved snapshots that are used for subsequent launches. The reserved snapshots are automatically replenished as they are used, depending on your settings for launch frequency. You can only change these settings for Windows AMIs that you own or that have been shared with you.
EXEC aws.ec2.images.enable_fast_launch
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@ResourceType='{{ ResourceType }}',
@SnapshotConfiguration='{{ SnapshotConfiguration }}',
@LaunchTemplate='{{ LaunchTemplate }}',
@MaxParallelLaunches='{{ MaxParallelLaunches }}',
@DryRun={{ DryRun }}
;
Enables block public access for AMIs at the account level in the specified Amazon Web Services Region. This prevents the public sharing of your AMIs. However, if you already have public AMIs, they will remain publicly available. The API can take up to 10 minutes to configure this setting. During this time, if you run GetImageBlockPublicAccessState, the response will be unblocked. When the API has completed the configuration, the response will be block-new-sharing. For more information, see Block public access to your AMIs in the Amazon EC2 User Guide.
EXEC aws.ec2.images.enable_image_block_public_access
@ImageBlockPublicAccessState='{{ ImageBlockPublicAccessState }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;
Enables deprecation of the specified AMI at the specified date and time. For more information, see Deprecate an AMI in the Amazon EC2 User Guide.
EXEC aws.ec2.images.enable_image_deprecation
@ImageId='{{ ImageId }}' --required,
@DeprecateAt='{{ DeprecateAt }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;
Enables deregistration protection for an AMI. When deregistration protection is enabled, the AMI can't be deregistered. To allow the AMI to be deregistered, you must first disable deregistration protection. For more information, see Protect an Amazon EC2 AMI from deregistration in the Amazon EC2 User Guide.
EXEC aws.ec2.images.enable_image_deregistration_protection
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@WithCooldown={{ WithCooldown }},
@DryRun={{ DryRun }}
;
Resets an attribute of an AMI to its default value.
EXEC aws.ec2.images.reset_image_attribute
@Attribute='{{ Attribute }}' --required,
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;
Restores an AMI from the Recycle Bin. For more information, see Recover deleted Amazon EBS snapshots and EBS-back AMIs with Recycle Bin in the Amazon EC2 User Guide.
EXEC aws.ec2.images.restore_image_from_recycle_bin
@ImageId='{{ ImageId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;