Skip to content

Commit e5eb29d

Browse files
author
awstools
committed
feat(client-s3): Added support for directory bucket creation with tags and bucket ARN retrieval in CreateBucket, ListDirectoryBuckets, and HeadBucket operations
1 parent af240bd commit e5eb29d

File tree

7 files changed

+123
-23
lines changed

7 files changed

+123
-23
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
213213
* DataRedundancy: "SingleAvailabilityZone" || "SingleLocalZone",
214214
* Type: "Directory",
215215
* },
216+
* Tags: [ // TagSet
217+
* { // Tag
218+
* Key: "STRING_VALUE", // required
219+
* Value: "STRING_VALUE", // required
220+
* },
221+
* ],
216222
* },
217223
* GrantFullControl: "STRING_VALUE",
218224
* GrantRead: "STRING_VALUE",
@@ -226,6 +232,7 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
226232
* const response = await client.send(command);
227233
* // { // CreateBucketOutput
228234
* // Location: "STRING_VALUE",
235+
* // BucketArn: "STRING_VALUE",
229236
* // };
230237
*
231238
* ```

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export interface HeadBucketCommandOutput extends HeadBucketOutput, __MetadataBea
111111
* const command = new HeadBucketCommand(input);
112112
* const response = await client.send(command);
113113
* // { // HeadBucketOutput
114+
* // BucketArn: "STRING_VALUE",
114115
* // BucketLocationType: "AvailabilityZone" || "LocalZone",
115116
* // BucketLocationName: "STRING_VALUE",
116117
* // BucketRegion: "STRING_VALUE",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface ListBucketsCommandOutput extends ListBucketsOutput, __MetadataB
7070
* // Name: "STRING_VALUE",
7171
* // CreationDate: new Date("TIMESTAMP"),
7272
* // BucketRegion: "STRING_VALUE",
73+
* // BucketArn: "STRING_VALUE",
7374
* // },
7475
* // ],
7576
* // Owner: { // Owner

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface ListDirectoryBucketsCommandOutput extends ListDirectoryBucketsO
7676
* // Name: "STRING_VALUE",
7777
* // CreationDate: new Date("TIMESTAMP"),
7878
* // BucketRegion: "STRING_VALUE",
79+
* // BucketArn: "STRING_VALUE",
7980
* // },
8081
* // ],
8182
* // ContinuationToken: "STRING_VALUE",

clients/client-s3/src/models/models_0.ts

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,15 @@ export interface CreateBucketOutput {
19831983
* @public
19841984
*/
19851985
Location?: string | undefined;
1986+
1987+
/**
1988+
* <p>The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services.</p>
1989+
* <note>
1990+
* <p>This parameter is only supported for S3 directory buckets. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html">Using tags with directory buckets</a>.</p>
1991+
* </note>
1992+
* @public
1993+
*/
1994+
BucketArn?: string | undefined;
19861995
}
19871996

19881997
/**
@@ -2133,6 +2142,24 @@ export const BucketLocationConstraint = {
21332142
*/
21342143
export type BucketLocationConstraint = (typeof BucketLocationConstraint)[keyof typeof BucketLocationConstraint];
21352144

2145+
/**
2146+
* <p>A container of a key value name pair.</p>
2147+
* @public
2148+
*/
2149+
export interface Tag {
2150+
/**
2151+
* <p>Name of the object key.</p>
2152+
* @public
2153+
*/
2154+
Key: string | undefined;
2155+
2156+
/**
2157+
* <p>Value of the tag.</p>
2158+
* @public
2159+
*/
2160+
Value: string | undefined;
2161+
}
2162+
21362163
/**
21372164
* <p>The configuration information for the bucket.</p>
21382165
* @public
@@ -2176,6 +2203,15 @@ export interface CreateBucketConfiguration {
21762203
* @public
21772204
*/
21782205
Bucket?: BucketInfo | undefined;
2206+
2207+
/**
2208+
* <p>An array of tags that you can apply to the bucket that you're creating. Tags are key-value pairs of metadata used to categorize and organize your buckets, track costs, and control access. </p>
2209+
* <note>
2210+
* <p>This parameter is only supported for S3 directory buckets. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html">Using tags with directory buckets</a>.</p>
2211+
* </note>
2212+
* @public
2213+
*/
2214+
Tags?: Tag[] | undefined;
21792215
}
21802216

21812217
/**
@@ -6195,24 +6231,6 @@ export interface GetBucketAclRequest {
61956231
ExpectedBucketOwner?: string | undefined;
61966232
}
61976233

6198-
/**
6199-
* <p>A container of a key value name pair.</p>
6200-
* @public
6201-
*/
6202-
export interface Tag {
6203-
/**
6204-
* <p>Name of the object key.</p>
6205-
* @public
6206-
*/
6207-
Key: string | undefined;
6208-
6209-
/**
6210-
* <p>Value of the tag.</p>
6211-
* @public
6212-
*/
6213-
Value: string | undefined;
6214-
}
6215-
62166234
/**
62176235
* <p>A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter.
62186236
* The operator must have at least two predicates in any combination, and an object must match
@@ -9002,6 +9020,8 @@ export interface Destination {
90029020
* object replica. </p>
90039021
* <p>For valid values, see the <code>StorageClass</code> element of the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html">PUT Bucket
90049022
* replication</a> action in the <i>Amazon S3 API Reference</i>.</p>
9023+
* <p>
9024+
* <code>FSX_OPENZFS</code> is not an accepted value when replicating objects.</p>
90059025
* @public
90069026
*/
90079027
StorageClass?: StorageClass | undefined;
@@ -11496,6 +11516,15 @@ export interface GetPublicAccessBlockRequest {
1149611516
* @public
1149711517
*/
1149811518
export interface HeadBucketOutput {
11519+
/**
11520+
* <p>The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services.</p>
11521+
* <note>
11522+
* <p>This parameter is only supported for S3 directory buckets. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html">Using tags with directory buckets</a>.</p>
11523+
* </note>
11524+
* @public
11525+
*/
11526+
BucketArn?: string | undefined;
11527+
1149911528
/**
1150011529
* <p>The type of location where the bucket is created.</p>
1150111530
* <note>
@@ -12523,6 +12552,15 @@ export interface Bucket {
1252312552
* @public
1252412553
*/
1252512554
BucketRegion?: string | undefined;
12555+
12556+
/**
12557+
* <p>The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services.</p>
12558+
* <note>
12559+
* <p>This parameter is only supported for S3 directory buckets. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html">Using tags with directory buckets</a>.</p>
12560+
* </note>
12561+
* @public
12562+
*/
12563+
BucketArn?: string | undefined;
1252612564
}
1252712565

1252812566
/**
@@ -12936,6 +12974,8 @@ export interface ListMultipartUploadsRequest {
1293612974
* substring starts at the beginning of the key. The keys that are grouped under
1293712975
* <code>CommonPrefixes</code> result element are not returned elsewhere in the
1293812976
* response.</p>
12977+
* <p>
12978+
* <code>CommonPrefixes</code> is filtered out from results if it is not lexicographically greater than the key-marker.</p>
1293912979
* <note>
1294012980
* <p>
1294112981
* <b>Directory buckets</b> - For directory buckets, <code>/</code> is the only supported delimiter.</p>
@@ -13383,6 +13423,8 @@ export interface ListObjectsRequest {
1338313423

1338413424
/**
1338513425
* <p>A delimiter is a character that you use to group keys.</p>
13426+
* <p>
13427+
* <code>CommonPrefixes</code> is filtered out from results if it is not lexicographically greater than the key-marker.</p>
1338613428
* @public
1338713429
*/
1338813430
Delimiter?: string | undefined;
@@ -13630,6 +13672,8 @@ export interface ListObjectsV2Request {
1363013672

1363113673
/**
1363213674
* <p>A delimiter is a character that you use to group keys.</p>
13675+
* <p>
13676+
* <code>CommonPrefixes</code> is filtered out from results if it is not lexicographically greater than the <code>StartAfter</code> value.</p>
1363313677
* <note>
1363413678
* <ul>
1363513679
* <li>
@@ -14006,6 +14050,8 @@ export interface ListObjectVersionsRequest {
1400614050
* grouped under a single result element in <code>CommonPrefixes</code>. These groups are
1400714051
* counted as one result against the <code>max-keys</code> limitation. These keys are not
1400814052
* returned elsewhere in the response.</p>
14053+
* <p>
14054+
* <code>CommonPrefixes</code> is filtered out from results if it is not lexicographically greater than the key-marker.</p>
1400914055
* @public
1401014056
*/
1401114057
Delimiter?: string | undefined;

clients/client-s3/src/protocols/Aws_restXml.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3384,6 +3384,7 @@ export const de_CreateBucketCommand = async (
33843384
const contents: any = map({
33853385
$metadata: deserializeMetadata(output),
33863386
[_L]: [, output.headers[_lo]],
3387+
[_BA]: [, output.headers[_xaba]],
33873388
});
33883389
await collectBody(output.body, context);
33893390
return contents;
@@ -4490,6 +4491,7 @@ export const de_HeadBucketCommand = async (
44904491
}
44914492
const contents: any = map({
44924493
$metadata: deserializeMetadata(output),
4494+
[_BA]: [, output.headers[_xaba]],
44934495
[_BLT]: [, output.headers[_xablt]],
44944496
[_BLN]: [, output.headers[_xabln]],
44954497
[_BR]: [, output.headers[_xabr]],
@@ -6244,6 +6246,7 @@ const se_CreateBucketConfiguration = (input: CreateBucketConfiguration, context:
62446246
if (input[_B] != null) {
62456247
bn.c(se_BucketInfo(input[_B], context).n(_B));
62466248
}
6249+
bn.lc(input, "Tags", "Tags", () => se_TagSet(input[_Tag]!, context));
62476250
return bn;
62486251
};
62496252

@@ -8011,6 +8014,9 @@ const de_Bucket = (output: any, context: __SerdeContext): Bucket => {
80118014
if (output[_BR] != null) {
80128015
contents[_BR] = __expectString(output[_BR]);
80138016
}
8017+
if (output[_BA] != null) {
8018+
contents[_BA] = __expectString(output[_BA]);
8019+
}
80148020
return contents;
80158021
};
80168022

@@ -10136,6 +10142,7 @@ const _ASSEBD = "ApplyServerSideEncryptionByDefault";
1013610142
const _AT = "AccessTier";
1013710143
const _Ac = "Account";
1013810144
const _B = "Bucket";
10145+
const _BA = "BucketArn";
1013910146
const _BAI = "BucketAccountId";
1014010147
const _BAS = "BucketAccelerateStatus";
1014110148
const _BGR = "BypassGovernanceRetention";
@@ -10678,6 +10685,7 @@ const _xaad = "x-amz-abort-date";
1067810685
const _xaapa = "x-amz-access-point-alias";
1067910686
const _xaari = "x-amz-abort-rule-id";
1068010687
const _xaas = "x-amz-archive-status";
10688+
const _xaba = "x-amz-bucket-arn";
1068110689
const _xabgr = "x-amz-bypass-governance-retention";
1068210690
const _xabln = "x-amz-bucket-location-name";
1068310691
const _xablt = "x-amz-bucket-location-type";

0 commit comments

Comments
 (0)