replace_root_volume_tasks
Creates, updates, deletes, gets or lists a replace_root_volume_tasks resource.
Overview
| Name | replace_root_volume_tasks |
| Type | Resource |
| Id | aws.ec2.replace_root_volume_tasks |
Fields
The following fields are returned by SELECT queries:
- describe_replace_root_volume_tasks
| Name | Datatype | Description |
|---|---|---|
complete_time | string | The time the task completed. |
delete_replaced_root_volume | boolean | Indicates whether the original root volume is to be deleted after the root volume replacement task completes. |
image_id | string | The ID of the AMI used to create the replacement root volume. |
instance_id | string | The ID of the instance for which the root volume replacement task was created. |
replace_root_volume_task_id | string | The ID of the root volume replacement task. |
snapshot_id | string | The ID of the snapshot used to create the replacement root volume. |
start_time | string | The time the task was started. |
tags | string | The tags assigned to the task. |
task_state | string | The state of the task. The task can be in one of the following states: pending - the replacement volume is being created. in-progress - the original volume is being detached and the replacement volume is being attached. succeeded - the replacement volume has been successfully attached to the instance and the instance is available. failing - the replacement task is in the process of failing. failed - the replacement task has failed but the original root volume is still attached. failing-detached - the replacement task is in the process of failing. The instance might have no root volume attached. failed-detached - the replacement task has failed and the instance has no root volume attached. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_replace_root_volume_tasks | select | region | ReplaceRootVolumeTaskId, Filter, MaxResults, NextToken, DryRun | Describes a root volume replacement task. For more information, see Replace a root volume in the Amazon EC2 User Guide. |
create_replace_root_volume_task | insert | InstanceId, region | SnapshotId, ClientToken, DryRun, TagSpecification, ImageId, DeleteReplacedRootVolume, VolumeInitializationRate, VolumeId | Replaces the EBS-backed root volume for a running instance with a new volume that is restored to the original root volume's launch state, that is restored to a specific snapshot taken from the original root volume, that is restored from an AMI that has the same key characteristics as that of the instance, or that is replaced by a specified volume. For more information, see Replace a root volume in the Amazon EC2 User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
InstanceId | string | The ID of the instance for which to replace the root volume. |
region | string | AWS region (default: us-east-1) |
ClientToken | string | Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency. For more information, see Ensuring idempotency. |
DeleteReplacedRootVolume | boolean | Indicates whether to automatically delete the original root volume after the root volume replacement task completes. To delete the original root volume, specify true. If you choose to keep the original root volume after the replacement task completes, you must manually delete it when you no longer need it. |
DryRun | boolean | 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. |
Filter | array | Filter to use: instance-id - The ID of the instance for which the root volume replacement task was created. |
ImageId | string | The ID of the AMI to use to restore the root volume. The specified AMI must have the same product code, billing information, architecture type, and virtualization type as that of the instance. If you want to restore the replacement volume from a specific snapshot, if you want to restore it to its launch state, or if you want to replace the root volume with a specified volume, omit this parameter. |
MaxResults | integer | The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
ReplaceRootVolumeTaskId | array | The ID of the root volume replacement task to view. |
SnapshotId | string | The ID of the snapshot from which to restore the replacement root volume. The specified snapshot must be a snapshot that you previously created from the original root volume. If you want to restore the replacement root volume to the initial launch state, if you want to restore the replacement root volume from an AMI, or if you want to replace the root volume with a specified volume, omit this parameter. |
TagSpecification | array | The tags to apply to the root volume replacement task. |
VolumeId | string | The ID of the volume to use as the replacement root volume. The specified volume must be in the same Availability Zone as the instance, must be in the available state, and must not be attached to an instance. If the original root volume is encrypted, the specified volume must also be encrypted. If you want to restore the replacement root volume from a specific snapshot, an AMI, or to its launch state, omit this parameter. |
VolumeInitializationRate | integer (int64) | Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the replacement root volume. This is also known as volume initialization. Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation. Omit this parameter if: You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation. If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore. You want to create a volume that is initialized at the default rate. For more information, see Initialize Amazon EBS volumes in the Amazon EC2 User Guide. Valid range: 100 - 300 MiB/s |
SELECT examples
- describe_replace_root_volume_tasks
Describes a root volume replacement task. For more information, see Replace a root volume in the Amazon EC2 User Guide.
SELECT
complete_time,
delete_replaced_root_volume,
image_id,
instance_id,
replace_root_volume_task_id,
snapshot_id,
start_time,
tags,
task_state
FROM aws.ec2.replace_root_volume_tasks
WHERE region = '{{ region }}' -- required
AND ReplaceRootVolumeTaskId = '{{ ReplaceRootVolumeTaskId }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
;
INSERT examples
- create_replace_root_volume_task
- Manifest
Replaces the EBS-backed root volume for a running instance with a new volume that is restored to the original root volume's launch state, that is restored to a specific snapshot taken from the original root volume, that is restored from an AMI that has the same key characteristics as that of the instance, or that is replaced by a specified volume. For more information, see Replace a root volume in the Amazon EC2 User Guide.
INSERT INTO aws.ec2.replace_root_volume_tasks (
InstanceId,
region,
SnapshotId,
ClientToken,
DryRun,
TagSpecification,
ImageId,
DeleteReplacedRootVolume,
VolumeInitializationRate,
VolumeId
)
SELECT
'{{ InstanceId }}',
'{{ region }}',
'{{ SnapshotId }}',
'{{ ClientToken }}',
'{{ DryRun }}',
'{{ TagSpecification }}',
'{{ ImageId }}',
'{{ DeleteReplacedRootVolume }}',
'{{ VolumeInitializationRate }}',
'{{ VolumeId }}'
RETURNING
complete_time,
delete_replaced_root_volume,
image_id,
instance_id,
replace_root_volume_task_id,
snapshot_id,
start_time,
tags,
task_state
;
# Description fields are for documentation purposes
- name: replace_root_volume_tasks
props:
- name: InstanceId
value: "{{ InstanceId }}"
description: Required parameter for the replace_root_volume_tasks resource.
- name: region
value: "{{ region }}"
description: Required parameter for the replace_root_volume_tasks resource.
- name: SnapshotId
value: "{{ SnapshotId }}"
description: The ID of the snapshot from which to restore the replacement root volume. The specified snapshot must be a snapshot that you previously created from the original root volume. If you want to restore the replacement root volume to the initial launch state, if you want to restore the replacement root volume from an AMI, or if you want to replace the root volume with a specified volume, omit this parameter.
description: The ID of the snapshot from which to restore the replacement root volume. The specified snapshot must be a snapshot that you previously created from the original root volume. If you want to restore the replacement root volume to the initial launch state, if you want to restore the replacement root volume from an AMI, or if you want to replace the root volume with a specified volume, omit this parameter.
- name: ClientToken
value: "{{ ClientToken }}"
description: Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency. For more information, see Ensuring idempotency.
description: Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency. For more information, see Ensuring idempotency.
- name: DryRun
value: {{ DryRun }}
description: 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.
description: 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.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to apply to the root volume replacement task.
description: The tags to apply to the root volume replacement task.
- name: ImageId
value: "{{ ImageId }}"
description: The ID of the AMI to use to restore the root volume. The specified AMI must have the same product code, billing information, architecture type, and virtualization type as that of the instance. If you want to restore the replacement volume from a specific snapshot, if you want to restore it to its launch state, or if you want to replace the root volume with a specified volume, omit this parameter.
description: The ID of the AMI to use to restore the root volume. The specified AMI must have the same product code, billing information, architecture type, and virtualization type as that of the instance. If you want to restore the replacement volume from a specific snapshot, if you want to restore it to its launch state, or if you want to replace the root volume with a specified volume, omit this parameter.
- name: DeleteReplacedRootVolume
value: {{ DeleteReplacedRootVolume }}
description: Indicates whether to automatically delete the original root volume after the root volume replacement task completes. To delete the original root volume, specify true. If you choose to keep the original root volume after the replacement task completes, you must manually delete it when you no longer need it.
description: Indicates whether to automatically delete the original root volume after the root volume replacement task completes. To delete the original root volume, specify true. If you choose to keep the original root volume after the replacement task completes, you must manually delete it when you no longer need it.
- name: VolumeInitializationRate
value: "{{ VolumeInitializationRate }}"
description: Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the replacement root volume. This is also known as volume initialization. Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation. Omit this parameter if: You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation. If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore. You want to create a volume that is initialized at the default rate. For more information, see Initialize Amazon EBS volumes in the Amazon EC2 User Guide. Valid range: 100 - 300 MiB/s
description: Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the replacement root volume. This is also known as volume initialization. Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation. Omit this parameter if: You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation. If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore. You want to create a volume that is initialized at the default rate. For more information, see Initialize Amazon EBS volumes in the Amazon EC2 User Guide. Valid range: 100 - 300 MiB/s
- name: VolumeId
value: "{{ VolumeId }}"
description: The ID of the volume to use as the replacement root volume. The specified volume must be in the same Availability Zone as the instance, must be in the available state, and must not be attached to an instance. If the original root volume is encrypted, the specified volume must also be encrypted. If you want to restore the replacement root volume from a specific snapshot, an AMI, or to its launch state, omit this parameter.
description: The ID of the volume to use as the replacement root volume. The specified volume must be in the same Availability Zone as the instance, must be in the available state, and must not be attached to an instance. If the original root volume is encrypted, the specified volume must also be encrypted. If you want to restore the replacement root volume from a specific snapshot, an AMI, or to its launch state, omit this parameter.