Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data CreateImage = CreateImage' {}
- newCreateImage :: Text -> Text -> CreateImage
- createImage_blockDeviceMappings :: Lens' CreateImage (Maybe [BlockDeviceMapping])
- createImage_description :: Lens' CreateImage (Maybe Text)
- createImage_dryRun :: Lens' CreateImage (Maybe Bool)
- createImage_noReboot :: Lens' CreateImage (Maybe Bool)
- createImage_tagSpecifications :: Lens' CreateImage (Maybe [TagSpecification])
- createImage_instanceId :: Lens' CreateImage Text
- createImage_name :: Lens' CreateImage Text
- data CreateImageResponse = CreateImageResponse' {
- imageId :: Maybe Text
- httpStatus :: Int
- newCreateImageResponse :: Int -> CreateImageResponse
- createImageResponse_imageId :: Lens' CreateImageResponse (Maybe Text)
- createImageResponse_httpStatus :: Lens' CreateImageResponse Int
Creating a Request
data CreateImage Source #
See: newCreateImage
smart constructor.
Constructors
CreateImage' | |
Fields
|
Instances
Arguments
:: Text | |
-> Text | |
-> CreateImage |
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 beimage
. - 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 besnapshot
. 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 beimage
. - 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 besnapshot
. 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_instanceId :: Lens' CreateImage Text Source #
The ID of the instance.
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
newCreateImageResponse Source #
Arguments
:: Int | |
-> CreateImageResponse |
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
createImageResponse_imageId :: Lens' CreateImageResponse (Maybe Text) Source #
The ID of the new AMI.
createImageResponse_httpStatus :: Lens' CreateImageResponse Int Source #
The response's http status code.