Skip to content

Commit c980e67

Browse files
author
awstools
committed
feat(client-ec2): Feature supports the replacement of instance root volume using an updated AMI without requiring customers to stop their instance.
1 parent 4978352 commit c980e67

File tree

5 files changed

+406
-333
lines changed

5 files changed

+406
-333
lines changed

clients/client-ec2/src/EC2.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6003,9 +6003,10 @@ export class EC2 extends EC2Client {
60036003
}
60046004

60056005
/**
6006-
* <p>Creates a root volume replacement task for an Amazon EC2 instance. The root volume
6007-
* can either be restored to its initial launch state, or it can be restored using a
6008-
* specific snapshot.</p>
6006+
* <p>Replaces the EBS-backed root volume for a <code>running</code> instance with a new
6007+
* volume that is restored to the original root volume's launch state, that is restored to a
6008+
* specific snapshot taken from the original root volume, or that is restored from an AMI
6009+
* that has the same key characteristics as that of the instance.</p>
60096010
*
60106011
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-restoring-volume.html#replace-root">Replace a root volume</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
60116012
*/

clients/client-ec2/src/commands/CreateReplaceRootVolumeTaskCommand.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ export interface CreateReplaceRootVolumeTaskCommandInput extends CreateReplaceRo
2929
export interface CreateReplaceRootVolumeTaskCommandOutput extends CreateReplaceRootVolumeTaskResult, __MetadataBearer {}
3030

3131
/**
32-
* <p>Creates a root volume replacement task for an Amazon EC2 instance. The root volume
33-
* can either be restored to its initial launch state, or it can be restored using a
34-
* specific snapshot.</p>
32+
* <p>Replaces the EBS-backed root volume for a <code>running</code> instance with a new
33+
* volume that is restored to the original root volume's launch state, that is restored to a
34+
* specific snapshot taken from the original root volume, or that is restored from an AMI
35+
* that has the same key characteristics as that of the instance.</p>
3536
*
3637
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-restoring-volume.html#replace-root">Replace a root volume</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
3738
* @example

clients/client-ec2/src/models/models_1.ts

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7172,8 +7172,12 @@ export interface CreateReplaceRootVolumeTaskRequest {
71727172
InstanceId: string | undefined;
71737173

71747174
/**
7175-
* <p>The ID of the snapshot from which to restore the replacement root volume. If you want to
7176-
* restore the volume to the initial launch state, omit this parameter.</p>
7175+
* <p>The ID of the snapshot from which to restore the replacement root volume. The
7176+
* specified snapshot must be a snapshot that you previously created from the original
7177+
* root volume.</p>
7178+
* <p>If you want to restore the replacement root volume to the initial launch state,
7179+
* or if you want to restore the replacement root volume from an AMI, omit this
7180+
* parameter.</p>
71777181
*/
71787182
SnapshotId?: string;
71797183

@@ -7195,6 +7199,23 @@ export interface CreateReplaceRootVolumeTaskRequest {
71957199
* <p>The tags to apply to the root volume replacement task.</p>
71967200
*/
71977201
TagSpecifications?: TagSpecification[];
7202+
7203+
/**
7204+
* <p>The ID of the AMI to use to restore the root volume. The specified AMI must have the
7205+
* same product code, billing information, architecture type, and virtualization type as
7206+
* that of the instance.</p>
7207+
* <p>If you want to restore the replacement volume from a specific snapshot, or if you want
7208+
* to restore it to its launch state, omit this parameter.</p>
7209+
*/
7210+
ImageId?: string;
7211+
7212+
/**
7213+
* <p>Indicates whether to automatically delete the original root volume after the root volume
7214+
* replacement task completes. To delete the original root volume, specify <code>true</code>.
7215+
* If you choose to keep the original root volume after the replacement task completes, you must
7216+
* manually delete it when you no longer need it.</p>
7217+
*/
7218+
DeleteReplacedRootVolume?: boolean;
71987219
}
71997220

72007221
export enum ReplaceRootVolumeTaskState {
@@ -7274,6 +7295,22 @@ export interface ReplaceRootVolumeTask {
72747295
* <p>The tags assigned to the task.</p>
72757296
*/
72767297
Tags?: Tag[];
7298+
7299+
/**
7300+
* <p>The ID of the AMI used to create the replacement root volume.</p>
7301+
*/
7302+
ImageId?: string;
7303+
7304+
/**
7305+
* <p>The ID of the snapshot used to create the replacement root volume.</p>
7306+
*/
7307+
SnapshotId?: string;
7308+
7309+
/**
7310+
* <p>Indicates whether the original root volume is to be deleted after the root volume
7311+
* replacement task completes.</p>
7312+
*/
7313+
DeleteReplacedRootVolume?: boolean;
72777314
}
72787315

72797316
export interface CreateReplaceRootVolumeTaskResult {

clients/client-ec2/src/protocols/Aws_ec2.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34257,6 +34257,12 @@ const serializeAws_ec2CreateReplaceRootVolumeTaskRequest = (
3425734257
entries[loc] = value;
3425834258
});
3425934259
}
34260+
if (input.ImageId != null) {
34261+
entries["ImageId"] = input.ImageId;
34262+
}
34263+
if (input.DeleteReplacedRootVolume != null) {
34264+
entries["DeleteReplacedRootVolume"] = input.DeleteReplacedRootVolume;
34265+
}
3426034266
return entries;
3426134267
};
3426234268

@@ -73040,6 +73046,9 @@ const deserializeAws_ec2ReplaceRootVolumeTask = (output: any, context: __SerdeCo
7304073046
StartTime: undefined,
7304173047
CompleteTime: undefined,
7304273048
Tags: undefined,
73049+
ImageId: undefined,
73050+
SnapshotId: undefined,
73051+
DeleteReplacedRootVolume: undefined,
7304373052
};
7304473053
if (output["replaceRootVolumeTaskId"] !== undefined) {
7304573054
contents.ReplaceRootVolumeTaskId = __expectString(output["replaceRootVolumeTaskId"]);
@@ -73061,6 +73070,15 @@ const deserializeAws_ec2ReplaceRootVolumeTask = (output: any, context: __SerdeCo
7306173070
} else if (output["tagSet"] !== undefined && output["tagSet"]["item"] !== undefined) {
7306273071
contents.Tags = deserializeAws_ec2TagList(__getArrayIfSingleItem(output["tagSet"]["item"]), context);
7306373072
}
73073+
if (output["imageId"] !== undefined) {
73074+
contents.ImageId = __expectString(output["imageId"]);
73075+
}
73076+
if (output["snapshotId"] !== undefined) {
73077+
contents.SnapshotId = __expectString(output["snapshotId"]);
73078+
}
73079+
if (output["deleteReplacedRootVolume"] !== undefined) {
73080+
contents.DeleteReplacedRootVolume = __parseBoolean(output["deleteReplacedRootVolume"]);
73081+
}
7306473082
return contents;
7306573083
};
7306673084

0 commit comments

Comments
 (0)