Skip to content

Commit 35be968

Browse files
author
awstools
committed
feat(client-ec2): This release adds support for creating instant, point-in-time copies of EBS volumes within the same Availability Zone
1 parent a34b5ea commit 35be968

22 files changed

+1240
-708
lines changed

clients/client-ec2/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,14 @@ CopySnapshot
685685

686686
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/CopySnapshotCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/CopySnapshotCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/CopySnapshotCommandOutput/)
687687

688+
</details>
689+
<details>
690+
<summary>
691+
CopyVolumes
692+
</summary>
693+
694+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/CopyVolumesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/CopyVolumesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/CopyVolumesCommandOutput/)
695+
688696
</details>
689697
<details>
690698
<summary>

clients/client-ec2/src/EC2.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ import {
298298
CopySnapshotCommandInput,
299299
CopySnapshotCommandOutput,
300300
} from "./commands/CopySnapshotCommand";
301+
import { CopyVolumesCommand, CopyVolumesCommandInput, CopyVolumesCommandOutput } from "./commands/CopyVolumesCommand";
301302
import {
302303
CreateCapacityReservationBySplittingCommand,
303304
CreateCapacityReservationBySplittingCommandInput,
@@ -3467,6 +3468,7 @@ const commands = {
34673468
CopyFpgaImageCommand,
34683469
CopyImageCommand,
34693470
CopySnapshotCommand,
3471+
CopyVolumesCommand,
34703472
CreateCapacityReservationCommand,
34713473
CreateCapacityReservationBySplittingCommand,
34723474
CreateCapacityReservationFleetCommand,
@@ -5094,6 +5096,17 @@ export interface EC2 {
50945096
cb: (err: any, data?: CopySnapshotCommandOutput) => void
50955097
): void;
50965098

5099+
/**
5100+
* @see {@link CopyVolumesCommand}
5101+
*/
5102+
copyVolumes(args: CopyVolumesCommandInput, options?: __HttpHandlerOptions): Promise<CopyVolumesCommandOutput>;
5103+
copyVolumes(args: CopyVolumesCommandInput, cb: (err: any, data?: CopyVolumesCommandOutput) => void): void;
5104+
copyVolumes(
5105+
args: CopyVolumesCommandInput,
5106+
options: __HttpHandlerOptions,
5107+
cb: (err: any, data?: CopyVolumesCommandOutput) => void
5108+
): void;
5109+
50975110
/**
50985111
* @see {@link CreateCapacityReservationCommand}
50995112
*/

clients/client-ec2/src/EC2Client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ import {
254254
import { CopyFpgaImageCommandInput, CopyFpgaImageCommandOutput } from "./commands/CopyFpgaImageCommand";
255255
import { CopyImageCommandInput, CopyImageCommandOutput } from "./commands/CopyImageCommand";
256256
import { CopySnapshotCommandInput, CopySnapshotCommandOutput } from "./commands/CopySnapshotCommand";
257+
import { CopyVolumesCommandInput, CopyVolumesCommandOutput } from "./commands/CopyVolumesCommand";
257258
import {
258259
CreateCapacityReservationBySplittingCommandInput,
259260
CreateCapacityReservationBySplittingCommandOutput,
@@ -2511,6 +2512,7 @@ export type ServiceInputTypes =
25112512
| CopyFpgaImageCommandInput
25122513
| CopyImageCommandInput
25132514
| CopySnapshotCommandInput
2515+
| CopyVolumesCommandInput
25142516
| CreateCapacityReservationBySplittingCommandInput
25152517
| CreateCapacityReservationCommandInput
25162518
| CreateCapacityReservationFleetCommandInput
@@ -3210,6 +3212,7 @@ export type ServiceOutputTypes =
32103212
| CopyFpgaImageCommandOutput
32113213
| CopyImageCommandOutput
32123214
| CopySnapshotCommandOutput
3215+
| CopyVolumesCommandOutput
32133216
| CreateCapacityReservationBySplittingCommandOutput
32143217
| CreateCapacityReservationCommandOutput
32153218
| CreateCapacityReservationFleetCommandOutput
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { CopyVolumesRequest, CopyVolumesResult } from "../models/models_1";
10+
import { de_CopyVolumesCommand, se_CopyVolumesCommand } from "../protocols/Aws_ec2";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link CopyVolumesCommand}.
21+
*/
22+
export interface CopyVolumesCommandInput extends CopyVolumesRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link CopyVolumesCommand}.
27+
*/
28+
export interface CopyVolumesCommandOutput extends CopyVolumesResult, __MetadataBearer {}
29+
30+
/**
31+
* <p>Creates a crash-consistent, point-in-time copy of an existing Amazon EBS volume within the same
32+
* Availability Zone. The volume copy can be attached to an Amazon EC2 instance once it reaches the
33+
* <code>available</code> state. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-copying-volume.html">Copy an Amazon EBS volume</a>.</p>
34+
* @example
35+
* Use a bare-bones client and the command you need to make an API call.
36+
* ```javascript
37+
* import { EC2Client, CopyVolumesCommand } from "@aws-sdk/client-ec2"; // ES Modules import
38+
* // const { EC2Client, CopyVolumesCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
39+
* // import type { EC2ClientConfig } from "@aws-sdk/client-ec2";
40+
* const config = {}; // type is EC2ClientConfig
41+
* const client = new EC2Client(config);
42+
* const input = { // CopyVolumesRequest
43+
* SourceVolumeId: "STRING_VALUE", // required
44+
* Iops: Number("int"),
45+
* Size: Number("int"),
46+
* VolumeType: "standard" || "io1" || "io2" || "gp2" || "sc1" || "st1" || "gp3",
47+
* DryRun: true || false,
48+
* TagSpecifications: [ // TagSpecificationList
49+
* { // TagSpecification
50+
* ResourceType: "capacity-reservation" || "client-vpn-endpoint" || "customer-gateway" || "carrier-gateway" || "coip-pool" || "declarative-policies-report" || "dedicated-host" || "dhcp-options" || "egress-only-internet-gateway" || "elastic-ip" || "elastic-gpu" || "export-image-task" || "export-instance-task" || "fleet" || "fpga-image" || "host-reservation" || "image" || "image-usage-report" || "import-image-task" || "import-snapshot-task" || "instance" || "instance-event-window" || "internet-gateway" || "ipam" || "ipam-pool" || "ipam-scope" || "ipv4pool-ec2" || "ipv6pool-ec2" || "key-pair" || "launch-template" || "local-gateway" || "local-gateway-route-table" || "local-gateway-virtual-interface" || "local-gateway-virtual-interface-group" || "local-gateway-route-table-vpc-association" || "local-gateway-route-table-virtual-interface-group-association" || "natgateway" || "network-acl" || "network-interface" || "network-insights-analysis" || "network-insights-path" || "network-insights-access-scope" || "network-insights-access-scope-analysis" || "outpost-lag" || "placement-group" || "prefix-list" || "replace-root-volume-task" || "reserved-instances" || "route-table" || "security-group" || "security-group-rule" || "service-link-virtual-interface" || "snapshot" || "spot-fleet-request" || "spot-instances-request" || "subnet" || "subnet-cidr-reservation" || "traffic-mirror-filter" || "traffic-mirror-session" || "traffic-mirror-target" || "transit-gateway" || "transit-gateway-attachment" || "transit-gateway-connect-peer" || "transit-gateway-multicast-domain" || "transit-gateway-policy-table" || "transit-gateway-route-table" || "transit-gateway-route-table-announcement" || "volume" || "vpc" || "vpc-endpoint" || "vpc-endpoint-connection" || "vpc-endpoint-service" || "vpc-endpoint-service-permission" || "vpc-peering-connection" || "vpn-connection" || "vpn-gateway" || "vpc-flow-log" || "capacity-reservation-fleet" || "traffic-mirror-filter-rule" || "vpc-endpoint-connection-device-type" || "verified-access-instance" || "verified-access-group" || "verified-access-endpoint" || "verified-access-policy" || "verified-access-trust-provider" || "vpn-connection-device-type" || "vpc-block-public-access-exclusion" || "route-server" || "route-server-endpoint" || "route-server-peer" || "ipam-resource-discovery" || "ipam-resource-discovery-association" || "instance-connect-endpoint" || "verified-access-endpoint-target" || "ipam-external-resource-verification-token" || "capacity-block" || "mac-modification-task",
51+
* Tags: [ // TagList
52+
* { // Tag
53+
* Key: "STRING_VALUE",
54+
* Value: "STRING_VALUE",
55+
* },
56+
* ],
57+
* },
58+
* ],
59+
* MultiAttachEnabled: true || false,
60+
* Throughput: Number("int"),
61+
* ClientToken: "STRING_VALUE",
62+
* };
63+
* const command = new CopyVolumesCommand(input);
64+
* const response = await client.send(command);
65+
* // { // CopyVolumesResult
66+
* // Volumes: [ // VolumeList
67+
* // { // Volume
68+
* // AvailabilityZoneId: "STRING_VALUE",
69+
* // OutpostArn: "STRING_VALUE",
70+
* // SourceVolumeId: "STRING_VALUE",
71+
* // Iops: Number("int"),
72+
* // Tags: [ // TagList
73+
* // { // Tag
74+
* // Key: "STRING_VALUE",
75+
* // Value: "STRING_VALUE",
76+
* // },
77+
* // ],
78+
* // VolumeType: "standard" || "io1" || "io2" || "gp2" || "sc1" || "st1" || "gp3",
79+
* // FastRestored: true || false,
80+
* // MultiAttachEnabled: true || false,
81+
* // Throughput: Number("int"),
82+
* // SseType: "sse-ebs" || "sse-kms" || "none",
83+
* // Operator: { // OperatorResponse
84+
* // Managed: true || false,
85+
* // Principal: "STRING_VALUE",
86+
* // },
87+
* // VolumeInitializationRate: Number("int"),
88+
* // VolumeId: "STRING_VALUE",
89+
* // Size: Number("int"),
90+
* // SnapshotId: "STRING_VALUE",
91+
* // AvailabilityZone: "STRING_VALUE",
92+
* // State: "creating" || "available" || "in-use" || "deleting" || "deleted" || "error",
93+
* // CreateTime: new Date("TIMESTAMP"),
94+
* // Attachments: [ // VolumeAttachmentList
95+
* // { // VolumeAttachment
96+
* // DeleteOnTermination: true || false,
97+
* // AssociatedResource: "STRING_VALUE",
98+
* // InstanceOwningService: "STRING_VALUE",
99+
* // VolumeId: "STRING_VALUE",
100+
* // InstanceId: "STRING_VALUE",
101+
* // Device: "STRING_VALUE",
102+
* // State: "attaching" || "attached" || "detaching" || "detached" || "busy",
103+
* // AttachTime: new Date("TIMESTAMP"),
104+
* // },
105+
* // ],
106+
* // Encrypted: true || false,
107+
* // KmsKeyId: "STRING_VALUE",
108+
* // },
109+
* // ],
110+
* // };
111+
*
112+
* ```
113+
*
114+
* @param CopyVolumesCommandInput - {@link CopyVolumesCommandInput}
115+
* @returns {@link CopyVolumesCommandOutput}
116+
* @see {@link CopyVolumesCommandInput} for command's `input` shape.
117+
* @see {@link CopyVolumesCommandOutput} for command's `response` shape.
118+
* @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape.
119+
*
120+
* @throws {@link EC2ServiceException}
121+
* <p>Base exception class for all service exceptions from EC2 service.</p>
122+
*
123+
*
124+
* @public
125+
*/
126+
export class CopyVolumesCommand extends $Command
127+
.classBuilder<
128+
CopyVolumesCommandInput,
129+
CopyVolumesCommandOutput,
130+
EC2ClientResolvedConfig,
131+
ServiceInputTypes,
132+
ServiceOutputTypes
133+
>()
134+
.ep(commonParams)
135+
.m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) {
136+
return [
137+
getSerdePlugin(config, this.serialize, this.deserialize),
138+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
139+
];
140+
})
141+
.s("AmazonEC2", "CopyVolumes", {})
142+
.n("EC2Client", "CopyVolumesCommand")
143+
.f(void 0, void 0)
144+
.ser(se_CopyVolumesCommand)
145+
.de(de_CopyVolumesCommand)
146+
.build() {
147+
/** @internal type navigation helper, not in runtime. */
148+
protected declare static __types: {
149+
api: {
150+
input: CopyVolumesRequest;
151+
output: CopyVolumesResult;
152+
};
153+
sdk: {
154+
input: CopyVolumesCommandInput;
155+
output: CopyVolumesCommandOutput;
156+
};
157+
};
158+
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { CreateVolumeRequest, Volume } from "../models/models_2";
9+
import { Volume } from "../models/models_1";
10+
import { CreateVolumeRequest } from "../models/models_2";
1011
import { de_CreateVolumeCommand, se_CreateVolumeCommand } from "../protocols/Aws_ec2";
1112

1213
/**
@@ -82,6 +83,7 @@ export interface CreateVolumeCommandOutput extends Volume, __MetadataBearer {}
8283
* // { // Volume
8384
* // AvailabilityZoneId: "STRING_VALUE",
8485
* // OutpostArn: "STRING_VALUE",
86+
* // SourceVolumeId: "STRING_VALUE",
8587
* // Iops: Number("int"),
8688
* // Tags: [ // TagList
8789
* // { // Tag

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { DescribeCapacityReservationBillingRequestsRequest } from "../models/models_3";
10-
import { DescribeCapacityReservationBillingRequestsResult } from "../models/models_4";
9+
import {
10+
DescribeCapacityReservationBillingRequestsRequest,
11+
DescribeCapacityReservationBillingRequestsResult,
12+
} from "../models/models_4";
1113
import {
1214
de_DescribeCapacityReservationBillingRequestsCommand,
1315
se_DescribeCapacityReservationBillingRequestsCommand,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { DescribeVolumeStatusRequest, DescribeVolumeStatusResult } from "../models/models_5";
9+
import { DescribeVolumeStatusRequest } from "../models/models_5";
10+
import { DescribeVolumeStatusResult } from "../models/models_6";
1011
import { de_DescribeVolumeStatusCommand, se_DescribeVolumeStatusCommand } from "../protocols/Aws_ec2";
1112

1213
/**
@@ -134,7 +135,7 @@ export interface DescribeVolumeStatusCommandOutput extends DescribeVolumeStatusR
134135
* // },
135136
* // ],
136137
* // InitializationStatusDetails: { // InitializationStatusDetails
137-
* // InitializationType: "default" || "provisioned-rate",
138+
* // InitializationType: "default" || "provisioned-rate" || "volume-copy",
138139
* // Progress: Number("long"),
139140
* // EstimatedTimeToCompleteInSeconds: Number("long"),
140141
* // },

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export interface DescribeVolumesCommandOutput extends DescribeVolumesResult, __M
7373
* // { // Volume
7474
* // AvailabilityZoneId: "STRING_VALUE",
7575
* // OutpostArn: "STRING_VALUE",
76+
* // SourceVolumeId: "STRING_VALUE",
7677
* // Iops: Number("int"),
7778
* // Tags: [ // TagList
7879
* // { // Tag

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { GetManagedPrefixListEntriesRequest, GetManagedPrefixListEntriesResult } from "../models/models_6";
9+
import { GetManagedPrefixListEntriesRequest } from "../models/models_6";
10+
import { GetManagedPrefixListEntriesResult } from "../models/models_7";
1011
import { de_GetManagedPrefixListEntriesCommand, se_GetManagedPrefixListEntriesCommand } from "../protocols/Aws_ec2";
1112

1213
/**

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { GetNetworkInsightsAccessScopeAnalysisFindingsRequest } from "../models/models_6";
10-
import { GetNetworkInsightsAccessScopeAnalysisFindingsResult } from "../models/models_7";
9+
import {
10+
GetNetworkInsightsAccessScopeAnalysisFindingsRequest,
11+
GetNetworkInsightsAccessScopeAnalysisFindingsResult,
12+
} from "../models/models_7";
1113
import {
1214
de_GetNetworkInsightsAccessScopeAnalysisFindingsCommand,
1315
se_GetNetworkInsightsAccessScopeAnalysisFindingsCommand,

0 commit comments

Comments
 (0)