Struct aws_sdk_ec2::client::fluent_builders::CreateImage
source · pub struct CreateImage { /* private fields */ }
Expand description
Fluent builder constructing a request to CreateImage
.
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.
Implementations§
source§impl CreateImage
impl CreateImage
sourcepub async fn customize(
self
) -> Result<CustomizableOperation<CreateImage, AwsResponseRetryClassifier>, SdkError<CreateImageError>>
pub async fn customize(
self
) -> Result<CustomizableOperation<CreateImage, AwsResponseRetryClassifier>, SdkError<CreateImageError>>
Consume this builder, creating a customizable operation that can be modified before being sent. The operation’s inner http::Request can be modified as well.
sourcepub async fn send(self) -> Result<CreateImageOutput, SdkError<CreateImageError>>
pub async fn send(self) -> Result<CreateImageOutput, SdkError<CreateImageError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn block_device_mappings(self, input: BlockDeviceMapping) -> Self
pub fn block_device_mappings(self, input: BlockDeviceMapping) -> Self
Appends an item to BlockDeviceMappings
.
To override the contents of this collection use set_block_device_mappings
.
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.
sourcepub fn set_block_device_mappings(
self,
input: Option<Vec<BlockDeviceMapping>>
) -> Self
pub fn set_block_device_mappings(
self,
input: Option<Vec<BlockDeviceMapping>>
) -> Self
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.
sourcepub fn description(self, input: impl Into<String>) -> Self
pub fn description(self, input: impl Into<String>) -> Self
A description for the new image.
sourcepub fn set_description(self, input: Option<String>) -> Self
pub fn set_description(self, input: Option<String>) -> Self
A description for the new image.
sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
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
.
sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
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
.
sourcepub fn instance_id(self, input: impl Into<String>) -> Self
pub fn instance_id(self, input: impl Into<String>) -> Self
The ID of the instance.
sourcepub fn set_instance_id(self, input: Option<String>) -> Self
pub fn set_instance_id(self, input: Option<String>) -> Self
The ID of the instance.
sourcepub fn name(self, input: impl Into<String>) -> Self
pub fn name(self, input: impl Into<String>) -> Self
A name for the new image.
Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
sourcepub fn set_name(self, input: Option<String>) -> Self
pub fn set_name(self, input: Option<String>) -> Self
A name for the new image.
Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
sourcepub fn no_reboot(self, input: bool) -> Self
pub fn no_reboot(self, input: bool) -> Self
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)
sourcepub fn set_no_reboot(self, input: Option<bool>) -> Self
pub fn set_no_reboot(self, input: Option<bool>) -> Self
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)
sourcepub fn tag_specifications(self, input: TagSpecification) -> Self
pub fn tag_specifications(self, input: TagSpecification) -> Self
Appends an item to TagSpecifications
.
To override the contents of this collection use set_tag_specifications
.
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.
sourcepub fn set_tag_specifications(self, input: Option<Vec<TagSpecification>>) -> Self
pub fn set_tag_specifications(self, input: Option<Vec<TagSpecification>>) -> Self
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.
Trait Implementations§
source§impl Clone for CreateImage
impl Clone for CreateImage
source§fn clone(&self) -> CreateImage
fn clone(&self) -> CreateImage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more