Skip to content

Commit

Permalink
feat(client-ec2): This release adds support for EBS local snapshots i…
Browse files Browse the repository at this point in the history
…n AWS Dedicated Local Zones, which allows you to store snapshots of EBS volumes locally in Dedicated Local Zones.
  • Loading branch information
awstools committed Dec 16, 2024
1 parent 8ea87b4 commit 0a3b2ac
Show file tree
Hide file tree
Showing 17 changed files with 396 additions and 248 deletions.
28 changes: 20 additions & 8 deletions clients/client-ec2/src/commands/CreateSnapshotCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,21 @@ export interface CreateSnapshotCommandOutput extends Snapshot, __MetadataBearer
* <p>Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for
* backups, to make copies of EBS volumes, and to save data before shutting down an
* instance.</p>
* <p>You can create snapshots of volumes in a Region and volumes on an Outpost. If you
* create a snapshot of a volume in a Region, the snapshot must be stored in the same
* Region as the volume. If you create a snapshot of a volume on an Outpost, the snapshot
* can be stored on the same Outpost as the volume, or in the Region for that Outpost.</p>
* <p>The location of the source EBS volume determines where you can create the snapshot.</p>
* <ul>
* <li>
* <p>If the source volume is in a Region, you must create the snapshot in the same
* Region as the volume.</p>
* </li>
* <li>
* <p>If the source volume is in a Local Zone, you can create the snapshot in the same
* Local Zone or in parent Amazon Web Services Region.</p>
* </li>
* <li>
* <p>If the source volume is on an Outpost, you can create the snapshot on the same
* Outpost or in its parent Amazon Web Services Region.</p>
* </li>
* </ul>
* <p>When a snapshot is created, any Amazon Web Services Marketplace product codes that are associated with the
* source volume are propagated to the snapshot.</p>
* <p>You can take a snapshot of an attached volume that is in use. However, snapshots only
Expand All @@ -49,10 +60,9 @@ export interface CreateSnapshotCommandOutput extends Snapshot, __MetadataBearer
* that you stop the instance before taking the snapshot.</p>
* <p>Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that
* are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes
* and any associated snapshots always remain protected.</p>
* <p>You can tag your snapshots during creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">Tag your Amazon EC2
* resources</a> in the <i>Amazon EC2 User Guide</i>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html">Amazon EBS</a> and <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a> in the <i>Amazon EBS User Guide</i>.</p>
* and any associated snapshots always remain protected. For more information,
* <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a>
* in the <i>Amazon EBS User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -74,6 +84,7 @@ export interface CreateSnapshotCommandOutput extends Snapshot, __MetadataBearer
* ],
* },
* ],
* Location: "regional" || "local",
* DryRun: true || false,
* };
* const command = new CreateSnapshotCommand(input);
Expand All @@ -90,6 +101,7 @@ export interface CreateSnapshotCommandOutput extends Snapshot, __MetadataBearer
* // StorageTier: "archive" || "standard",
* // RestoreExpiryTime: new Date("TIMESTAMP"),
* // SseType: "sse-ebs" || "sse-kms" || "none",
* // AvailabilityZone: "STRING_VALUE",
* // TransferType: "time-based" || "standard",
* // CompletionDurationMinutes: Number("int"),
* // CompletionTime: new Date("TIMESTAMP"),
Expand Down
32 changes: 22 additions & 10 deletions clients/client-ec2/src/commands/CreateSnapshotsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,26 @@ export interface CreateSnapshotsCommandInput extends CreateSnapshotsRequest {}
export interface CreateSnapshotsCommandOutput extends CreateSnapshotsResult, __MetadataBearer {}

/**
* <p>Creates crash-consistent snapshots of multiple EBS volumes and stores the data in S3.
* Volumes are chosen by specifying an instance. Any attached volumes will produce one snapshot
* each that is crash-consistent across the instance.</p>
* <p>You can include all of the volumes currently attached to the instance, or you can exclude
* the root volume or specific data (non-root) volumes from the multi-volume snapshot set.</p>
* <p>You can create multi-volume snapshots of instances in a Region and instances on an
* Outpost. If you create snapshots from an instance in a Region, the snapshots must be stored
* in the same Region as the instance. If you create snapshots from an instance on an Outpost,
* the snapshots can be stored on the same Outpost as the instance, or in the Region for that
* Outpost.</p>
* <p>Creates crash-consistent snapshots of multiple EBS volumes attached to an Amazon EC2 instance.
* Volumes are chosen by specifying an instance. Each volume attached to the specified instance
* will produce one snapshot that is crash-consistent across the instance. You can include all of
* the volumes currently attached to the instance, or you can exclude the root volume or specific
* data (non-root) volumes from the multi-volume snapshot set.</p>
* <p>The location of the source instance determines where you can create the snapshots.</p>
* <ul>
* <li>
* <p>If the source instance is in a Region, you must create the snapshots in the same
* Region as the instance.</p>
* </li>
* <li>
* <p>If the source instance is in a Local Zone, you can create the snapshots in the same
* Local Zone or in parent Amazon Web Services Region.</p>
* </li>
* <li>
* <p>If the source instance is on an Outpost, you can create the snapshots on the same
* Outpost or in its parent Amazon Web Services Region.</p>
* </li>
* </ul>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -67,6 +77,7 @@ export interface CreateSnapshotsCommandOutput extends CreateSnapshotsResult, __M
* ],
* DryRun: true || false,
* CopyTagsFromSource: "volume",
* Location: "regional" || "local",
* };
* const command = new CreateSnapshotsCommand(input);
* const response = await client.send(command);
Expand All @@ -90,6 +101,7 @@ export interface CreateSnapshotsCommandOutput extends CreateSnapshotsResult, __M
* // SnapshotId: "STRING_VALUE",
* // OutpostArn: "STRING_VALUE",
* // SseType: "sse-ebs" || "sse-kms" || "none",
* // AvailabilityZone: "STRING_VALUE",
* // },
* // ],
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { DeleteClientVpnRouteRequest } from "../models/models_2";
import { DeleteClientVpnRouteResult } from "../models/models_3";
import { DeleteClientVpnRouteRequest, DeleteClientVpnRouteResult } from "../models/models_3";
import { de_DeleteClientVpnRouteCommand, se_DeleteClientVpnRouteCommand } from "../protocols/Aws_ec2";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { DescribeFleetHistoryRequest, DescribeFleetHistoryResult } from "../models/models_3";
import { DescribeFleetHistoryRequest } from "../models/models_3";
import { DescribeFleetHistoryResult } from "../models/models_4";
import { de_DescribeFleetHistoryCommand, se_DescribeFleetHistoryCommand } from "../protocols/Aws_ec2";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export interface DescribeSnapshotsCommandOutput extends DescribeSnapshotsResult,
* // StorageTier: "archive" || "standard",
* // RestoreExpiryTime: new Date("TIMESTAMP"),
* // SseType: "sse-ebs" || "sse-kms" || "none",
* // AvailabilityZone: "STRING_VALUE",
* // TransferType: "time-based" || "standard",
* // CompletionDurationMinutes: Number("int"),
* // CompletionTime: new Date("TIMESTAMP"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { EnableAddressTransferRequest, EnableAddressTransferResult } from "../models/models_5";
import { EnableAddressTransferRequest } from "../models/models_5";
import { EnableAddressTransferResult } from "../models/models_6";
import { de_EnableAddressTransferCommand, se_EnableAddressTransferCommand } from "../protocols/Aws_ec2";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { ModifyInstanceEventWindowRequest } from "../models/models_6";
import { ModifyInstanceEventWindowResult } from "../models/models_7";
import { ModifyInstanceEventWindowRequest, ModifyInstanceEventWindowResult } from "../models/models_7";
import { de_ModifyInstanceEventWindowCommand, se_ModifyInstanceEventWindowCommand } from "../protocols/Aws_ec2";

/**
Expand Down
3 changes: 1 addition & 2 deletions clients/client-ec2/src/commands/UnlockSnapshotCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { UnlockSnapshotRequest } from "../models/models_7";
import { UnlockSnapshotResult } from "../models/models_8";
import { UnlockSnapshotRequest, UnlockSnapshotResult } from "../models/models_8";
import { de_UnlockSnapshotCommand, se_UnlockSnapshotCommand } from "../protocols/Aws_ec2";

/**
Expand Down
142 changes: 86 additions & 56 deletions clients/client-ec2/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3012,6 +3012,20 @@ export interface CreateSecurityGroupResult {
SecurityGroupArn?: string | undefined;
}

/**
* @public
* @enum
*/
export const SnapshotLocationEnum = {
LOCAL: "local",
REGIONAL: "regional",
} as const;

/**
* @public
*/
export type SnapshotLocationEnum = (typeof SnapshotLocationEnum)[keyof typeof SnapshotLocationEnum];

/**
* @public
*/
Expand All @@ -3023,22 +3037,17 @@ export interface CreateSnapshotRequest {
Description?: string | undefined;

/**
* <p>The Amazon Resource Name (ARN) of the Outpost on which to create a local
* snapshot.</p>
* <note>
* <p>Only supported for volumes on Outposts. If the source volume is not on an Outpost,
* omit this parameter.</p>
* </note>
* <ul>
* <li>
* <p>To create a snapshot of a volume in a Region, omit this parameter. The snapshot
* is created in the same Region as the volume.</p>
* <p>To create the snapshot on the same Outpost as the source volume, specify the
* ARN of that Outpost. The snapshot must be created on the same Outpost as the volume.</p>
* </li>
* <li>
* <p>To create a snapshot of a volume on an Outpost and store the snapshot in the
* Region, omit this parameter. The snapshot is created in the Region for the
* Outpost.</p>
* </li>
* <li>
* <p>To create a snapshot of a volume on an Outpost and store the snapshot on an
* Outpost, specify the ARN of the destination Outpost. The snapshot must be created on
* the same Outpost as the volume.</p>
* <p>To create the snapshot in the parent Region of the Outpost, omit this parameter.</p>
* </li>
* </ul>
* <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot">Create local snapshots from volumes on an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
Expand All @@ -3058,6 +3067,27 @@ export interface CreateSnapshotRequest {
*/
TagSpecifications?: TagSpecification[] | undefined;

/**
* <note>
* <p>Only supported for volumes in Local Zones. If the source volume is not in a Local Zone,
* omit this parameter.</p>
* </note>
* <ul>
* <li>
* <p>To create a local snapshot in the same Local Zone as the source volume, specify
* <code>local</code>.</p>
* </li>
* <li>
* <p>To create a regional snapshot in the parent Region of the Local Zone, specify
* <code>regional</code> or omit this parameter.</p>
* </li>
* </ul>
* <p>Default value: <code>regional</code>
* </p>
* @public
*/
Location?: SnapshotLocationEnum | undefined;

/**
* <p>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 <code>DryRunOperation</code>.
Expand Down Expand Up @@ -3174,6 +3204,13 @@ export interface Snapshot {
*/
SseType?: SSEType | undefined;

/**
* <p>The Availability Zone or Local Zone of the snapshot. For example, <code>us-west-1a</code>
* (Availability Zone) or <code>us-west-2-lax-1a</code> (Local Zone).</p>
* @public
*/
AvailabilityZone?: string | undefined;

/**
* <note>
* <p>Only for snapshot copies.</p>
Expand Down Expand Up @@ -3353,27 +3390,21 @@ export interface CreateSnapshotsRequest {
InstanceSpecification: InstanceSpecification | undefined;

/**
* <p>The Amazon Resource Name (ARN) of the Outpost on which to create the local
* snapshots.</p>
* <note>
* <p>Only supported for instances on Outposts. If the source instance is not on an Outpost,
* omit this parameter.</p>
* </note>
* <ul>
* <li>
* <p>To create snapshots from an instance in a Region, omit this parameter. The
* snapshots are created in the same Region as the instance.</p>
* </li>
* <li>
* <p>To create snapshots from an instance on an Outpost and store the snapshots
* in the Region, omit this parameter. The snapshots are created in the Region
* for the Outpost.</p>
* <p>To create the snapshots on the same Outpost as the source instance, specify the
* ARN of that Outpost. The snapshots must be created on the same Outpost as the instance.</p>
* </li>
* <li>
* <p>To create snapshots from an instance on an Outpost and store the snapshots
* on an Outpost, specify the ARN of the destination Outpost. The snapshots must
* be created on the same Outpost as the instance.</p>
* <p>To create the snapshots in the parent Region of the Outpost, omit this parameter.</p>
* </li>
* </ul>
* <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-multivol-snapshot">
* Create multi-volume local snapshots from instances on an Outpost</a> in the
* <i>Amazon EBS User Guide</i>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot">
* Create local snapshots from volumes on an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
* @public
*/
OutpostArn?: string | undefined;
Expand All @@ -3397,6 +3428,27 @@ export interface CreateSnapshotsRequest {
* @public
*/
CopyTagsFromSource?: CopyTagsFromSource | undefined;

/**
* <note>
* <p>Only supported for instances in Local Zones. If the source instance is not in a Local Zone,
* omit this parameter.</p>
* </note>
* <ul>
* <li>
* <p>To create local snapshots in the same Local Zone as the source instance, specify
* <code>local</code>.</p>
* </li>
* <li>
* <p>To create a regional snapshots in the parent Region of the Local Zone, specify
* <code>regional</code> or omit this parameter.</p>
* </li>
* </ul>
* <p>Default value: <code>regional</code>
* </p>
* @public
*/
Location?: SnapshotLocationEnum | undefined;
}

/**
Expand Down Expand Up @@ -3478,6 +3530,13 @@ export interface SnapshotInfo {
* @public
*/
SseType?: SSEType | undefined;

/**
* <p>The Availability Zone or Local Zone of the snapshots. For example, <code>us-west-1a</code>
* (Availability Zone) or <code>us-west-2-lax-1a</code> (Local Zone).</p>
* @public
*/
AvailabilityZone?: string | undefined;
}

/**
Expand Down Expand Up @@ -10286,35 +10345,6 @@ export interface DeleteClientVpnEndpointResult {
Status?: ClientVpnEndpointStatus | undefined;
}

/**
* @public
*/
export interface DeleteClientVpnRouteRequest {
/**
* <p>The ID of the Client VPN endpoint from which the route is to be deleted.</p>
* @public
*/
ClientVpnEndpointId: string | undefined;

/**
* <p>The ID of the target subnet used by the route.</p>
* @public
*/
TargetVpcSubnetId?: string | undefined;

/**
* <p>The IPv4 address range, in CIDR notation, of the route to be deleted.</p>
* @public
*/
DestinationCidrBlock: string | undefined;

/**
* <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
* @public
*/
DryRun?: boolean | undefined;
}

/**
* @internal
*/
Expand Down
Loading

0 comments on commit 0a3b2ac

Please sign in to comment.