Skip to content

Commit

Permalink
feat(client-s3): Adds support for S3 Express One Zone.
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Nov 28, 2023
1 parent 871dd41 commit 1dcc776
Show file tree
Hide file tree
Showing 105 changed files with 10,929 additions and 4,884 deletions.
16 changes: 16 additions & 0 deletions clients/client-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ CreateMultipartUpload

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/CreateMultipartUploadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/CreateMultipartUploadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/CreateMultipartUploadCommandOutput/)

</details>
<details>
<summary>
CreateSession
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/CreateSessionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/CreateSessionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/CreateSessionCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -666,6 +674,14 @@ ListBuckets

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/ListBucketsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/ListBucketsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/ListBucketsCommandOutput/)

</details>
<details>
<summary>
ListDirectoryBuckets
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/ListDirectoryBucketsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/ListDirectoryBucketsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/ListDirectoryBucketsCommandOutput/)

</details>
<details>
<summary>
Expand Down
40 changes: 40 additions & 0 deletions clients/client-s3/src/S3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import {
CreateMultipartUploadCommandInput,
CreateMultipartUploadCommandOutput,
} from "./commands/CreateMultipartUploadCommand";
import {
CreateSessionCommand,
CreateSessionCommandInput,
CreateSessionCommandOutput,
} from "./commands/CreateSessionCommand";
import {
DeleteBucketAnalyticsConfigurationCommand,
DeleteBucketAnalyticsConfigurationCommandInput,
Expand Down Expand Up @@ -272,6 +277,11 @@ import {
ListBucketMetricsConfigurationsCommandOutput,
} from "./commands/ListBucketMetricsConfigurationsCommand";
import { ListBucketsCommand, ListBucketsCommandInput, ListBucketsCommandOutput } from "./commands/ListBucketsCommand";
import {
ListDirectoryBucketsCommand,
ListDirectoryBucketsCommandInput,
ListDirectoryBucketsCommandOutput,
} from "./commands/ListDirectoryBucketsCommand";
import {
ListMultipartUploadsCommand,
ListMultipartUploadsCommandInput,
Expand Down Expand Up @@ -439,6 +449,7 @@ const commands = {
CopyObjectCommand,
CreateBucketCommand,
CreateMultipartUploadCommand,
CreateSessionCommand,
DeleteBucketCommand,
DeleteBucketAnalyticsConfigurationCommand,
DeleteBucketCorsCommand,
Expand Down Expand Up @@ -492,6 +503,7 @@ const commands = {
ListBucketInventoryConfigurationsCommand,
ListBucketMetricsConfigurationsCommand,
ListBucketsCommand,
ListDirectoryBucketsCommand,
ListMultipartUploadsCommand,
ListObjectsCommand,
ListObjectsV2Command,
Expand Down Expand Up @@ -603,6 +615,17 @@ export interface S3 {
cb: (err: any, data?: CreateMultipartUploadCommandOutput) => void
): void;

/**
* @see {@link CreateSessionCommand}
*/
createSession(args: CreateSessionCommandInput, options?: __HttpHandlerOptions): Promise<CreateSessionCommandOutput>;
createSession(args: CreateSessionCommandInput, cb: (err: any, data?: CreateSessionCommandOutput) => void): void;
createSession(
args: CreateSessionCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateSessionCommandOutput) => void
): void;

/**
* @see {@link DeleteBucketCommand}
*/
Expand Down Expand Up @@ -1441,6 +1464,23 @@ export interface S3 {
cb: (err: any, data?: ListBucketsCommandOutput) => void
): void;

/**
* @see {@link ListDirectoryBucketsCommand}
*/
listDirectoryBuckets(
args: ListDirectoryBucketsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListDirectoryBucketsCommandOutput>;
listDirectoryBuckets(
args: ListDirectoryBucketsCommandInput,
cb: (err: any, data?: ListDirectoryBucketsCommandOutput) => void
): void;
listDirectoryBuckets(
args: ListDirectoryBucketsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListDirectoryBucketsCommandOutput) => void
): void;

/**
* @see {@link ListMultipartUploadsCommand}
*/
Expand Down
17 changes: 16 additions & 1 deletion clients/client-s3/src/S3Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
import {
getRegionRedirectMiddlewarePlugin,
getS3ExpressPlugin,
getValidateBucketNamePlugin,
resolveS3Config,
S3InputConfig,
Expand Down Expand Up @@ -81,6 +82,11 @@ import {
CreateMultipartUploadCommandInput,
CreateMultipartUploadCommandOutput,
} from "./commands/CreateMultipartUploadCommand";
import {
CreateSessionCommand,
CreateSessionCommandInput,
CreateSessionCommandOutput,
} from "./commands/CreateSessionCommand";
import {
DeleteBucketAnalyticsConfigurationCommandInput,
DeleteBucketAnalyticsConfigurationCommandOutput,
Expand Down Expand Up @@ -230,6 +236,10 @@ import {
ListBucketMetricsConfigurationsCommandOutput,
} from "./commands/ListBucketMetricsConfigurationsCommand";
import { ListBucketsCommandInput, ListBucketsCommandOutput } from "./commands/ListBucketsCommand";
import {
ListDirectoryBucketsCommandInput,
ListDirectoryBucketsCommandOutput,
} from "./commands/ListDirectoryBucketsCommand";
import {
ListMultipartUploadsCommandInput,
ListMultipartUploadsCommandOutput,
Expand Down Expand Up @@ -336,6 +346,7 @@ export type ServiceInputTypes =
| CopyObjectCommandInput
| CreateBucketCommandInput
| CreateMultipartUploadCommandInput
| CreateSessionCommandInput
| DeleteBucketAnalyticsConfigurationCommandInput
| DeleteBucketCommandInput
| DeleteBucketCorsCommandInput
Expand Down Expand Up @@ -389,6 +400,7 @@ export type ServiceInputTypes =
| ListBucketInventoryConfigurationsCommandInput
| ListBucketMetricsConfigurationsCommandInput
| ListBucketsCommandInput
| ListDirectoryBucketsCommandInput
| ListMultipartUploadsCommandInput
| ListObjectVersionsCommandInput
| ListObjectsCommandInput
Expand Down Expand Up @@ -434,6 +446,7 @@ export type ServiceOutputTypes =
| CopyObjectCommandOutput
| CreateBucketCommandOutput
| CreateMultipartUploadCommandOutput
| CreateSessionCommandOutput
| DeleteBucketAnalyticsConfigurationCommandOutput
| DeleteBucketCommandOutput
| DeleteBucketCorsCommandOutput
Expand Down Expand Up @@ -487,6 +500,7 @@ export type ServiceOutputTypes =
| ListBucketInventoryConfigurationsCommandOutput
| ListBucketMetricsConfigurationsCommandOutput
| ListBucketsCommandOutput
| ListDirectoryBucketsCommandOutput
| ListMultipartUploadsCommandOutput
| ListObjectVersionsCommandOutput
| ListObjectsCommandOutput
Expand Down Expand Up @@ -767,7 +781,7 @@ export class S3Client extends __Client<
const _config_4 = resolveRetryConfig(_config_3);
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveS3Config(_config_6);
const _config_7 = resolveS3Config(_config_6, { session: [() => this, CreateSessionCommand] });
const _config_8 = resolveUserAgentConfig(_config_7);
const _config_9 = resolveEventStreamSerdeConfig(_config_8);
const _config_10 = resolveRuntimeExtensions(_config_9, configuration?.extensions || []);
Expand All @@ -782,6 +796,7 @@ export class S3Client extends __Client<
this.middlewareStack.use(getValidateBucketNamePlugin(this.config));
this.middlewareStack.use(getAddExpectContinuePlugin(this.config));
this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config));
this.middlewareStack.use(getS3ExpressPlugin(this.config));
this.middlewareStack.use(getUserAgentPlugin(this.config));
}

Expand Down
43 changes: 38 additions & 5 deletions clients/client-s3/src/commands/AbortMultipartUploadCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,49 @@ export interface AbortMultipartUploadCommandOutput extends AbortMultipartUploadO

/**
* @public
* <p>This action aborts a multipart upload. After a multipart upload is aborted, no
* <p>This operation aborts a multipart upload. After a multipart upload is aborted, no
* additional parts can be uploaded using that upload ID. The storage consumed by any
* previously uploaded parts will be freed. However, if any part uploads are currently in
* progress, those part uploads might or might not succeed. As a result, it might be necessary
* to abort a given multipart upload multiple times in order to completely free all storage
* consumed by all parts. </p>
* <p>To verify that all parts have been removed, so you don't get charged for the part
* storage, you should call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> action and ensure that
* <p>To verify that all parts have been removed and prevent getting charged for the part
* storage, you should call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> API operation and ensure that
* the parts list is empty.</p>
* <p>For information about permissions required to use the multipart upload, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload
* and Permissions</a>.</p>
* <note>
* <p>
* <b>Directory buckets</b> - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format <code>https://<i>bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com/<i>key-name</i>
* </code>. Path-style requests are not supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html">Regional and Zonal endpoints</a> in the
* <i>Amazon S3 User Guide</i>.</p>
* </note>
* <dl>
* <dt>Permissions</dt>
* <dd>
* <ul>
* <li>
* <p>
* <b>General purpose bucket permissions</b> - For information about permissions required to use the multipart upload, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload
* and Permissions</a> in the <i>Amazon S3
* User Guide</i>.</p>
* </li>
* <li>
* <p>
* <b>Directory bucket permissions</b> - To grant access to this API operation on a directory bucket, we recommend that you use the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html">
* <code>CreateSession</code>
* </a> API operation for session-based authorization. Specifically, you grant the <code>s3express:CreateSession</code> permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the <code>CreateSession</code> API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another <code>CreateSession</code> API call to generate a new session token for use.
* Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html">
* <code>CreateSession</code>
* </a>.</p>
* </li>
* </ul>
* </dd>
* <dt>HTTP Host header syntax</dt>
* <dd>
* <p>
* <b>Directory buckets </b> - The HTTP Host header syntax is <code>
* <i>Bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com</code>.</p>
* </dd>
* </dl>
* <p>The following operations are related to <code>AbortMultipartUpload</code>:</p>
* <ul>
* <li>
Expand Down Expand Up @@ -136,6 +168,7 @@ export class AbortMultipartUploadCommand extends $Command<
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },
Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" },
DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" },
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Expand Down

0 comments on commit 1dcc776

Please sign in to comment.