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.CreateImage

Description

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.

By default, when Amazon EC2 creates the new AMI, it reboots the instance so that it can take snapshots of the attached volumes while data is at rest, in order to ensure a consistent state. You can set the NoReboot parameter to true in the API request, or use the --no-reboot option in the CLI to prevent Amazon EC2 from shutting down and rebooting the instance.

If you choose to bypass the shutdown and reboot process by setting the NoReboot parameter to true in the API request, or by using the --no-reboot option in the CLI, we can't guarantee the file system integrity of the created image.

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.

For more information, see Create an Amazon EBS-backed Linux AMI in the Amazon Elastic Compute Cloud User Guide.

Synopsis

Creating a Request

data CreateImage Source #

See: newCreateImage smart constructor.

Constructors

CreateImage' 

Fields

  • blockDeviceMappings :: Maybe [BlockDeviceMapping]

    The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.

  • description :: Maybe Text

    A description for the new image.

  • 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.

  • noReboot :: Maybe Bool

    By default, when Amazon EC2 creates the new AMI, it reboots the instance so that it can take snapshots of the attached volumes while data is at rest, in order to ensure a consistent state. You can set the NoReboot parameter to true in the API request, or use the --no-reboot option in the CLI to prevent Amazon EC2 from shutting down and rebooting the instance.

    If you choose to bypass the shutdown and reboot process by setting the NoReboot parameter to true in the API request, or by using the --no-reboot option in the CLI, we can't guarantee the file system integrity of the created image.

    Default: false (follow standard reboot process)

  • tagSpecifications :: Maybe [TagSpecification]

    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.

  • instanceId :: Text

    The ID of the instance.

  • name :: Text

    A name for the new image.

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

Instances

Instances details
ToHeaders CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Methods

toHeaders :: CreateImage -> [Header] #

ToPath CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

ToQuery CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

AWSRequest CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Associated Types

type AWSResponse CreateImage #

Generic CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Associated Types

type Rep CreateImage :: Type -> Type #

Read CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Show CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

NFData CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Methods

rnf :: CreateImage -> () #

Eq CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Hashable CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

type AWSResponse CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

type Rep CreateImage Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

newCreateImage Source #

Create a value of CreateImage 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:

CreateImage, createImage_blockDeviceMappings - The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.

CreateImage, createImage_description - A description for the new image.

$sel:dryRun:CreateImage', createImage_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.

$sel:noReboot:CreateImage', createImage_noReboot - By default, when Amazon EC2 creates the new AMI, it reboots the instance so that it can take snapshots of the attached volumes while data is at rest, in order to ensure a consistent state. You can set the NoReboot parameter to true in the API request, or use the --no-reboot option in the CLI to prevent Amazon EC2 from shutting down and rebooting the instance.

If you choose to bypass the shutdown and reboot process by setting the NoReboot parameter to true in the API request, or by using the --no-reboot option in the CLI, we can't guarantee the file system integrity of the created image.

Default: false (follow standard reboot process)

CreateImage, createImage_tagSpecifications - 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.

CreateImage, createImage_instanceId - The ID of the instance.

CreateImage, createImage_name - A name for the new image.

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

Request Lenses

createImage_blockDeviceMappings :: Lens' CreateImage (Maybe [BlockDeviceMapping]) Source #

The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.

createImage_description :: Lens' CreateImage (Maybe Text) Source #

A description for the new image.

createImage_dryRun :: Lens' CreateImage (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.

createImage_noReboot :: Lens' CreateImage (Maybe Bool) Source #

By default, when Amazon EC2 creates the new AMI, it reboots the instance so that it can take snapshots of the attached volumes while data is at rest, in order to ensure a consistent state. You can set the NoReboot parameter to true in the API request, or use the --no-reboot option in the CLI to prevent Amazon EC2 from shutting down and rebooting the instance.

If you choose to bypass the shutdown and reboot process by setting the NoReboot parameter to true in the API request, or by using the --no-reboot option in the CLI, we can't guarantee the file system integrity of the created image.

Default: false (follow standard reboot process)

createImage_tagSpecifications :: Lens' CreateImage (Maybe [TagSpecification]) Source #

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.

createImage_name :: Lens' CreateImage Text Source #

A name for the new image.

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

Destructuring the Response

data CreateImageResponse Source #

See: newCreateImageResponse smart constructor.

Constructors

CreateImageResponse' 

Fields

Instances

Instances details
Generic CreateImageResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Associated Types

type Rep CreateImageResponse :: Type -> Type #

Read CreateImageResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Show CreateImageResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

NFData CreateImageResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

Methods

rnf :: CreateImageResponse -> () #

Eq CreateImageResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

type Rep CreateImageResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateImage

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

newCreateImageResponse Source #

Create a value of CreateImageResponse 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:

CreateImageResponse, createImageResponse_imageId - The ID of the new AMI.

$sel:httpStatus:CreateImageResponse', createImageResponse_httpStatus - The response's http status code.

Response Lenses