register_image
async
¶
register_image(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
image_location: Optional[String] = None,
billing_products: Optional[BillingProductList] = None,
boot_mode: Optional[BootModeValues] = None,
tpm_support: Optional[TpmSupportValues] = None,
uefi_data: Optional[ImageUefiDataRequest] = None,
imds_support: Optional[ImdsSupportValues] = None,
tag_specifications: Optional[TagSpecificationList] = None,
dry_run: Optional[Boolean] = None,
name: Optional[ImageNameRequest] = None,
description: Optional[ImageDescriptionRequest] = None,
architecture: Optional[ArchitectureValues] = None,
kernel_id: Optional[KernelId] = None,
ramdisk_id: Optional[RamdiskId] = None,
root_device_name: Optional[String] = None,
block_device_mappings: Optional[BlockDeviceMappingRequestList] = None,
virtualization_type: Optional[String] = None,
sriov_net_support: Optional[String] = None,
ena_support: Optional[Boolean] = None,
) -> RegisterImageResult
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.
Parameters:
-
image_location(Optional[String], default:None) –The full path to your AMI manifest in Amazon S3 storage. The specified bucket must have the
aws-exec-readcanned 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. -
billing_products(Optional[BillingProductList], default:None) –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.
-
boot_mode(Optional[BootModeValues], default:None) –The boot mode of the AMI. A value of
uefi-preferredindicates 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.
-
tpm_support(Optional[TpmSupportValues], default:None) –Set to
v2.0to enable Trusted Platform Module (TPM) support. For more information, see NitroTPM in the Amazon EC2 User Guide. -
uefi_data(Optional[ImageUefiDataRequest], default:None) –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.
-
imds_support(Optional[ImdsSupportValues], default:None) –Set to
v2.0to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will haveHttpTokensautomatically set torequiredso that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition,HttpPutResponseHopLimitis set to2. 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. -
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to apply to the AMI.
To tag the AMI, the value for
ResourceTypemust beimage. If you specify another value forResourceType, the request fails.To tag an AMI after it has been registered, see CreateTags.
-
dry_run(Optional[Boolean], default:None) –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 isUnauthorizedOperation. -
name(Optional[ImageNameRequest], default:None) –A name for your AMI.
Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
-
description(Optional[ImageDescriptionRequest], default:None) –A description for your AMI.
-
architecture(Optional[ArchitectureValues], default:None) –The architecture of the AMI.
Default: For Amazon EBS-backed AMIs,
i386. For instance store-backed AMIs, the architecture specified in the manifest file. -
kernel_id(Optional[KernelId], default:None) –The ID of the kernel.
-
ramdisk_id(Optional[RamdiskId], default:None) –The ID of the RAM disk.
-
root_device_name(Optional[String], default:None) –The device name of the root device volume (for example,
/dev/sda1). -
block_device_mappings(Optional[BlockDeviceMappingRequestList], default:None) –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.
-
virtualization_type(Optional[String], default:None) –The type of virtualization (
hvm|paravirtual).Default:
paravirtual -
sriov_net_support(Optional[String], default:None) –Set to
simpleto 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
sriovNetSupportat 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.
-
ena_support(Optional[Boolean], default:None) –Set to
trueto 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.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/async_ec2.py
56763 56764 56765 56766 56767 56768 56769 56770 56771 56772 56773 56774 56775 56776 56777 56778 56779 56780 56781 56782 56783 56784 56785 56786 56787 56788 56789 56790 56791 56792 56793 56794 56795 56796 56797 56798 56799 56800 56801 56802 56803 56804 56805 56806 56807 56808 56809 56810 56811 56812 56813 56814 56815 56816 56817 56818 56819 56820 56821 56822 56823 56824 56825 56826 56827 56828 56829 56830 56831 56832 56833 56834 56835 56836 56837 56838 56839 56840 56841 56842 56843 56844 56845 56846 56847 56848 56849 56850 56851 56852 56853 56854 56855 56856 56857 56858 56859 56860 56861 56862 56863 56864 56865 56866 56867 56868 56869 56870 56871 56872 56873 56874 56875 56876 56877 56878 56879 56880 56881 56882 56883 56884 56885 56886 56887 56888 56889 56890 56891 56892 56893 56894 56895 56896 56897 56898 | |