amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.RegisterImage

Description

Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, see Create your own AMI in the Amazon Elastic Compute Cloud User Guide.

For Amazon EBS-backed instances, CreateImage creates and registers the AMI in a single request, so you don't have to register the AMI yourself. We recommend that you always use CreateImage unless you have a specific reason to use RegisterImage.

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 a Linux AMI from a snapshot and Use encryption with Amazon EBS-backed AMIs in the Amazon Elastic Compute Cloud 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.

Windows and some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES), use the Amazon EC2 billing product code associated with an AMI to verify the subscription status for package updates. To create a new AMI for operating systems that require a billing product code, instead of registering the AMI, do the following to preserve the billing product code association:

  1. Launch an instance from an existing AMI with that billing product code.
  2. Customize the instance.
  3. Create an AMI from the instance using CreateImage.

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 will not be 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.

Synopsis

Creating a Request

data RegisterImage Source #

Contains the parameters for RegisterImage.

See: newRegisterImage smart constructor.

Constructors

RegisterImage' 

Fields

  • architecture :: Maybe ArchitectureValues

    The architecture of the AMI.

    Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

  • billingProducts :: Maybe [Text]

    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 a seller and AMI-based products in the Amazon Web Services Marketplace Seller Guide.

  • blockDeviceMappings :: Maybe [BlockDeviceMapping]

    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, Amazon EBS local snapshots on Outposts in the Amazon EC2 User Guide.

  • bootMode :: Maybe BootModeValues

    The boot mode of the AMI. For more information, see Boot modes in the Amazon EC2 User Guide.

  • description :: Maybe Text

    A description for your AMI.

  • dryRun :: Maybe Bool

    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 :: Maybe Bool

    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.

  • imageLocation :: Maybe Text

    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 ACLs in the Amazon S3 Service Developer Guide.

  • imdsSupport :: Maybe ImdsSupportValues

    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.

  • kernelId :: Maybe Text

    The ID of the kernel.

  • ramdiskId :: Maybe Text

    The ID of the RAM disk.

  • rootDeviceName :: Maybe Text

    The device name of the root device volume (for example, /dev/sda1).

  • sriovNetSupport :: Maybe Text

    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.

  • tpmSupport :: Maybe TpmSupportValues

    Set to v2.0 to enable Trusted Platform Module (TPM) support. For more information, see NitroTPM in the Amazon EC2 User Guide.

  • uefiData :: Maybe Text

    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 in the Amazon EC2 User Guide.

  • virtualizationType :: Maybe Text

    The type of virtualization (hvm | paravirtual).

    Default: paravirtual

  • name :: Text

    A name for your AMI.

    Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

Instances

Instances details
ToHeaders RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

ToPath RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

ToQuery RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

AWSRequest RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Associated Types

type AWSResponse RegisterImage #

Generic RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Associated Types

type Rep RegisterImage :: Type -> Type #

Read RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Show RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

NFData RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Methods

rnf :: RegisterImage -> () #

Eq RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Hashable RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

type AWSResponse RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

type Rep RegisterImage Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

type Rep RegisterImage = D1 ('MetaData "RegisterImage" "Amazonka.EC2.RegisterImage" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "RegisterImage'" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "architecture") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ArchitectureValues)) :*: S1 ('MetaSel ('Just "billingProducts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text]))) :*: (S1 ('MetaSel ('Just "blockDeviceMappings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [BlockDeviceMapping])) :*: S1 ('MetaSel ('Just "bootMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe BootModeValues)))) :*: ((S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "enaSupport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "imageLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))) :*: (((S1 ('MetaSel ('Just "imdsSupport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ImdsSupportValues)) :*: S1 ('MetaSel ('Just "kernelId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "ramdiskId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "rootDeviceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "sriovNetSupport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "tpmSupport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TpmSupportValues))) :*: (S1 ('MetaSel ('Just "uefiData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "virtualizationType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))))

newRegisterImage Source #

Create a value of RegisterImage with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

RegisterImage, registerImage_architecture - The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

$sel:billingProducts:RegisterImage', registerImage_billingProducts - 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 a seller and AMI-based products in the Amazon Web Services Marketplace Seller Guide.

RegisterImage, registerImage_blockDeviceMappings - 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, Amazon EBS local snapshots on Outposts in the Amazon EC2 User Guide.

RegisterImage, registerImage_bootMode - The boot mode of the AMI. For more information, see Boot modes in the Amazon EC2 User Guide.

RegisterImage, registerImage_description - A description for your AMI.

$sel:dryRun:RegisterImage', registerImage_dryRun - 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.

RegisterImage, registerImage_enaSupport - 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.

RegisterImage, registerImage_imageLocation - 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 ACLs in the Amazon S3 Service Developer Guide.

RegisterImage, registerImage_imdsSupport - 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.

RegisterImage, registerImage_kernelId - The ID of the kernel.

RegisterImage, registerImage_ramdiskId - The ID of the RAM disk.

RegisterImage, registerImage_rootDeviceName - The device name of the root device volume (for example, /dev/sda1).

RegisterImage, registerImage_sriovNetSupport - 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.

RegisterImage, registerImage_tpmSupport - Set to v2.0 to enable Trusted Platform Module (TPM) support. For more information, see NitroTPM in the Amazon EC2 User Guide.

$sel:uefiData:RegisterImage', registerImage_uefiData - 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 in the Amazon EC2 User Guide.

RegisterImage, registerImage_virtualizationType - The type of virtualization (hvm | paravirtual).

Default: paravirtual

RegisterImage, registerImage_name - A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

Request Lenses

registerImage_architecture :: Lens' RegisterImage (Maybe ArchitectureValues) Source #

The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

registerImage_billingProducts :: Lens' RegisterImage (Maybe [Text]) Source #

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 a seller and AMI-based products in the Amazon Web Services Marketplace Seller Guide.

registerImage_blockDeviceMappings :: Lens' RegisterImage (Maybe [BlockDeviceMapping]) Source #

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, Amazon EBS local snapshots on Outposts in the Amazon EC2 User Guide.

registerImage_bootMode :: Lens' RegisterImage (Maybe BootModeValues) Source #

The boot mode of the AMI. For more information, see Boot modes in the Amazon EC2 User Guide.

registerImage_dryRun :: Lens' RegisterImage (Maybe Bool) Source #

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.

registerImage_enaSupport :: Lens' RegisterImage (Maybe Bool) Source #

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.

registerImage_imageLocation :: Lens' RegisterImage (Maybe Text) Source #

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 ACLs in the Amazon S3 Service Developer Guide.

registerImage_imdsSupport :: Lens' RegisterImage (Maybe ImdsSupportValues) Source #

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.

registerImage_rootDeviceName :: Lens' RegisterImage (Maybe Text) Source #

The device name of the root device volume (for example, /dev/sda1).

registerImage_sriovNetSupport :: Lens' RegisterImage (Maybe Text) Source #

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.

registerImage_tpmSupport :: Lens' RegisterImage (Maybe TpmSupportValues) Source #

Set to v2.0 to enable Trusted Platform Module (TPM) support. For more information, see NitroTPM in the Amazon EC2 User Guide.

registerImage_uefiData :: Lens' RegisterImage (Maybe Text) Source #

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 in the Amazon EC2 User Guide.

registerImage_virtualizationType :: Lens' RegisterImage (Maybe Text) Source #

The type of virtualization (hvm | paravirtual).

Default: paravirtual

registerImage_name :: Lens' RegisterImage Text Source #

A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

Destructuring the Response

data RegisterImageResponse Source #

Contains the output of RegisterImage.

See: newRegisterImageResponse smart constructor.

Constructors

RegisterImageResponse' 

Fields

Instances

Instances details
Generic RegisterImageResponse Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Associated Types

type Rep RegisterImageResponse :: Type -> Type #

Read RegisterImageResponse Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Show RegisterImageResponse Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

NFData RegisterImageResponse Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

Methods

rnf :: RegisterImageResponse -> () #

Eq RegisterImageResponse Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

type Rep RegisterImageResponse Source # 
Instance details

Defined in Amazonka.EC2.RegisterImage

type Rep RegisterImageResponse = D1 ('MetaData "RegisterImageResponse" "Amazonka.EC2.RegisterImage" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "RegisterImageResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "imageId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newRegisterImageResponse Source #

Create a value of RegisterImageResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

RegisterImageResponse, registerImageResponse_imageId - The ID of the newly registered AMI.

$sel:httpStatus:RegisterImageResponse', registerImageResponse_httpStatus - The response's http status code.

Response Lenses