Skip to content

Commit 1dcc776

Browse files
author
awstools
committed
feat(client-s3): Adds support for S3 Express One Zone.
1 parent 871dd41 commit 1dcc776

File tree

105 files changed

+10929
-4884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+10929
-4884
lines changed

clients/client-s3/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,14 @@ CreateMultipartUpload
242242

243243
[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/)
244244

245+
</details>
246+
<details>
247+
<summary>
248+
CreateSession
249+
</summary>
250+
251+
[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/)
252+
245253
</details>
246254
<details>
247255
<summary>
@@ -666,6 +674,14 @@ ListBuckets
666674

667675
[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/)
668676

677+
</details>
678+
<details>
679+
<summary>
680+
ListDirectoryBuckets
681+
</summary>
682+
683+
[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/)
684+
669685
</details>
670686
<details>
671687
<summary>

clients/client-s3/src/S3.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import {
2323
CreateMultipartUploadCommandInput,
2424
CreateMultipartUploadCommandOutput,
2525
} from "./commands/CreateMultipartUploadCommand";
26+
import {
27+
CreateSessionCommand,
28+
CreateSessionCommandInput,
29+
CreateSessionCommandOutput,
30+
} from "./commands/CreateSessionCommand";
2631
import {
2732
DeleteBucketAnalyticsConfigurationCommand,
2833
DeleteBucketAnalyticsConfigurationCommandInput,
@@ -272,6 +277,11 @@ import {
272277
ListBucketMetricsConfigurationsCommandOutput,
273278
} from "./commands/ListBucketMetricsConfigurationsCommand";
274279
import { ListBucketsCommand, ListBucketsCommandInput, ListBucketsCommandOutput } from "./commands/ListBucketsCommand";
280+
import {
281+
ListDirectoryBucketsCommand,
282+
ListDirectoryBucketsCommandInput,
283+
ListDirectoryBucketsCommandOutput,
284+
} from "./commands/ListDirectoryBucketsCommand";
275285
import {
276286
ListMultipartUploadsCommand,
277287
ListMultipartUploadsCommandInput,
@@ -439,6 +449,7 @@ const commands = {
439449
CopyObjectCommand,
440450
CreateBucketCommand,
441451
CreateMultipartUploadCommand,
452+
CreateSessionCommand,
442453
DeleteBucketCommand,
443454
DeleteBucketAnalyticsConfigurationCommand,
444455
DeleteBucketCorsCommand,
@@ -492,6 +503,7 @@ const commands = {
492503
ListBucketInventoryConfigurationsCommand,
493504
ListBucketMetricsConfigurationsCommand,
494505
ListBucketsCommand,
506+
ListDirectoryBucketsCommand,
495507
ListMultipartUploadsCommand,
496508
ListObjectsCommand,
497509
ListObjectsV2Command,
@@ -603,6 +615,17 @@ export interface S3 {
603615
cb: (err: any, data?: CreateMultipartUploadCommandOutput) => void
604616
): void;
605617

618+
/**
619+
* @see {@link CreateSessionCommand}
620+
*/
621+
createSession(args: CreateSessionCommandInput, options?: __HttpHandlerOptions): Promise<CreateSessionCommandOutput>;
622+
createSession(args: CreateSessionCommandInput, cb: (err: any, data?: CreateSessionCommandOutput) => void): void;
623+
createSession(
624+
args: CreateSessionCommandInput,
625+
options: __HttpHandlerOptions,
626+
cb: (err: any, data?: CreateSessionCommandOutput) => void
627+
): void;
628+
606629
/**
607630
* @see {@link DeleteBucketCommand}
608631
*/
@@ -1441,6 +1464,23 @@ export interface S3 {
14411464
cb: (err: any, data?: ListBucketsCommandOutput) => void
14421465
): void;
14431466

1467+
/**
1468+
* @see {@link ListDirectoryBucketsCommand}
1469+
*/
1470+
listDirectoryBuckets(
1471+
args: ListDirectoryBucketsCommandInput,
1472+
options?: __HttpHandlerOptions
1473+
): Promise<ListDirectoryBucketsCommandOutput>;
1474+
listDirectoryBuckets(
1475+
args: ListDirectoryBucketsCommandInput,
1476+
cb: (err: any, data?: ListDirectoryBucketsCommandOutput) => void
1477+
): void;
1478+
listDirectoryBuckets(
1479+
args: ListDirectoryBucketsCommandInput,
1480+
options: __HttpHandlerOptions,
1481+
cb: (err: any, data?: ListDirectoryBucketsCommandOutput) => void
1482+
): void;
1483+
14441484
/**
14451485
* @see {@link ListMultipartUploadsCommand}
14461486
*/

clients/client-s3/src/S3Client.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
1010
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
1111
import {
1212
getRegionRedirectMiddlewarePlugin,
13+
getS3ExpressPlugin,
1314
getValidateBucketNamePlugin,
1415
resolveS3Config,
1516
S3InputConfig,
@@ -81,6 +82,11 @@ import {
8182
CreateMultipartUploadCommandInput,
8283
CreateMultipartUploadCommandOutput,
8384
} from "./commands/CreateMultipartUploadCommand";
85+
import {
86+
CreateSessionCommand,
87+
CreateSessionCommandInput,
88+
CreateSessionCommandOutput,
89+
} from "./commands/CreateSessionCommand";
8490
import {
8591
DeleteBucketAnalyticsConfigurationCommandInput,
8692
DeleteBucketAnalyticsConfigurationCommandOutput,
@@ -230,6 +236,10 @@ import {
230236
ListBucketMetricsConfigurationsCommandOutput,
231237
} from "./commands/ListBucketMetricsConfigurationsCommand";
232238
import { ListBucketsCommandInput, ListBucketsCommandOutput } from "./commands/ListBucketsCommand";
239+
import {
240+
ListDirectoryBucketsCommandInput,
241+
ListDirectoryBucketsCommandOutput,
242+
} from "./commands/ListDirectoryBucketsCommand";
233243
import {
234244
ListMultipartUploadsCommandInput,
235245
ListMultipartUploadsCommandOutput,
@@ -336,6 +346,7 @@ export type ServiceInputTypes =
336346
| CopyObjectCommandInput
337347
| CreateBucketCommandInput
338348
| CreateMultipartUploadCommandInput
349+
| CreateSessionCommandInput
339350
| DeleteBucketAnalyticsConfigurationCommandInput
340351
| DeleteBucketCommandInput
341352
| DeleteBucketCorsCommandInput
@@ -389,6 +400,7 @@ export type ServiceInputTypes =
389400
| ListBucketInventoryConfigurationsCommandInput
390401
| ListBucketMetricsConfigurationsCommandInput
391402
| ListBucketsCommandInput
403+
| ListDirectoryBucketsCommandInput
392404
| ListMultipartUploadsCommandInput
393405
| ListObjectVersionsCommandInput
394406
| ListObjectsCommandInput
@@ -434,6 +446,7 @@ export type ServiceOutputTypes =
434446
| CopyObjectCommandOutput
435447
| CreateBucketCommandOutput
436448
| CreateMultipartUploadCommandOutput
449+
| CreateSessionCommandOutput
437450
| DeleteBucketAnalyticsConfigurationCommandOutput
438451
| DeleteBucketCommandOutput
439452
| DeleteBucketCorsCommandOutput
@@ -487,6 +500,7 @@ export type ServiceOutputTypes =
487500
| ListBucketInventoryConfigurationsCommandOutput
488501
| ListBucketMetricsConfigurationsCommandOutput
489502
| ListBucketsCommandOutput
503+
| ListDirectoryBucketsCommandOutput
490504
| ListMultipartUploadsCommandOutput
491505
| ListObjectVersionsCommandOutput
492506
| ListObjectsCommandOutput
@@ -767,7 +781,7 @@ export class S3Client extends __Client<
767781
const _config_4 = resolveRetryConfig(_config_3);
768782
const _config_5 = resolveHostHeaderConfig(_config_4);
769783
const _config_6 = resolveAwsAuthConfig(_config_5);
770-
const _config_7 = resolveS3Config(_config_6);
784+
const _config_7 = resolveS3Config(_config_6, { session: [() => this, CreateSessionCommand] });
771785
const _config_8 = resolveUserAgentConfig(_config_7);
772786
const _config_9 = resolveEventStreamSerdeConfig(_config_8);
773787
const _config_10 = resolveRuntimeExtensions(_config_9, configuration?.extensions || []);
@@ -782,6 +796,7 @@ export class S3Client extends __Client<
782796
this.middlewareStack.use(getValidateBucketNamePlugin(this.config));
783797
this.middlewareStack.use(getAddExpectContinuePlugin(this.config));
784798
this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config));
799+
this.middlewareStack.use(getS3ExpressPlugin(this.config));
785800
this.middlewareStack.use(getUserAgentPlugin(this.config));
786801
}
787802

clients/client-s3/src/commands/AbortMultipartUploadCommand.ts

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,49 @@ export interface AbortMultipartUploadCommandOutput extends AbortMultipartUploadO
3737

3838
/**
3939
* @public
40-
* <p>This action aborts a multipart upload. After a multipart upload is aborted, no
40+
* <p>This operation aborts a multipart upload. After a multipart upload is aborted, no
4141
* additional parts can be uploaded using that upload ID. The storage consumed by any
4242
* previously uploaded parts will be freed. However, if any part uploads are currently in
4343
* progress, those part uploads might or might not succeed. As a result, it might be necessary
4444
* to abort a given multipart upload multiple times in order to completely free all storage
4545
* consumed by all parts. </p>
46-
* <p>To verify that all parts have been removed, so you don't get charged for the part
47-
* storage, you should call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> action and ensure that
46+
* <p>To verify that all parts have been removed and prevent getting charged for the part
47+
* 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
4848
* the parts list is empty.</p>
49-
* <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
50-
* and Permissions</a>.</p>
49+
* <note>
50+
* <p>
51+
* <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>
52+
* </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
53+
* <i>Amazon S3 User Guide</i>.</p>
54+
* </note>
55+
* <dl>
56+
* <dt>Permissions</dt>
57+
* <dd>
58+
* <ul>
59+
* <li>
60+
* <p>
61+
* <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
62+
* and Permissions</a> in the <i>Amazon S3
63+
* User Guide</i>.</p>
64+
* </li>
65+
* <li>
66+
* <p>
67+
* <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">
68+
* <code>CreateSession</code>
69+
* </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.
70+
* 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">
71+
* <code>CreateSession</code>
72+
* </a>.</p>
73+
* </li>
74+
* </ul>
75+
* </dd>
76+
* <dt>HTTP Host header syntax</dt>
77+
* <dd>
78+
* <p>
79+
* <b>Directory buckets </b> - The HTTP Host header syntax is <code>
80+
* <i>Bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com</code>.</p>
81+
* </dd>
82+
* </dl>
5183
* <p>The following operations are related to <code>AbortMultipartUpload</code>:</p>
5284
* <ul>
5385
* <li>
@@ -136,6 +168,7 @@ export class AbortMultipartUploadCommand extends $Command<
136168
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
137169
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },
138170
Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" },
171+
DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" },
139172
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
140173
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
141174
Endpoint: { type: "builtInParams", name: "endpoint" },

0 commit comments

Comments
 (0)