Skip to content

Commit 67ff7cc

Browse files
author
awstools
committed
feat(client-s3): Add Bucket Metrics configuration support to directory buckets
1 parent 4f13aba commit 67ff7cc

7 files changed

Lines changed: 233 additions & 48 deletions

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export interface DeleteBucketInventoryConfigurationCommandOutput extends __Metad
3636
* bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3
3737
* Resources</a>.</p>
3838
* <p>For information about the Amazon S3 inventory feature, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html">Amazon S3 Inventory</a>.</p>
39+
* <note>
40+
* <p>After deleting a configuration, Amazon S3 might still deliver one additional inventory
41+
* report during a brief transition period while the system processes the deletion.</p>
42+
* </note>
3943
* <p>Operations related to <code>DeleteBucketInventoryConfiguration</code> include: </p>
4044
* <ul>
4145
* <li>

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

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,46 @@ export interface DeleteBucketMetricsConfigurationCommandInput extends DeleteBuck
2727
export interface DeleteBucketMetricsConfigurationCommandOutput extends __MetadataBearer {}
2828

2929
/**
30-
* <note>
31-
* <p>This operation is not supported for directory buckets.</p>
32-
* </note>
33-
* <p>Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics
30+
* <p>Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics
3431
* configuration ID) from the bucket. Note that this doesn't include the daily storage metrics.</p>
35-
* <p> To use this operation, you must have permissions to perform the
36-
* <code>s3:PutMetricsConfiguration</code> action. The bucket owner has this permission by default. The
37-
* bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3
38-
* Resources</a>.</p>
32+
* <note>
33+
* <p>
34+
* <b>Directory buckets </b> - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i>
35+
* </code>. Virtual-hosted-style requests aren't supported.
36+
* For more information about endpoints in Availability Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/endpoint-directory-buckets-AZ.html">Regional and Zonal endpoints for directory buckets in Availability Zones</a> in the
37+
* <i>Amazon S3 User Guide</i>. For more information about endpoints in Local Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html">Concepts for directory buckets in Local Zones</a> in the
38+
* <i>Amazon S3 User Guide</i>.</p>
39+
* </note>
40+
* <dl>
41+
* <dt>Permissions</dt>
42+
* <dd>
43+
* <p> To use this operation, you must have permissions to perform the
44+
* <code>s3:PutMetricsConfiguration</code> action. The bucket owner has this permission by default. The
45+
* bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3
46+
* Resources</a>.</p>
47+
* <ul>
48+
* <li>
49+
* <p>
50+
* <b>General purpose bucket permissions</b> - The
51+
* <code>s3:PutMetricsConfiguration</code> permission is required in a policy. For more information
52+
* about general purpose buckets permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies and User
53+
* Policies</a> in the <i>Amazon S3 User Guide</i>.</p>
54+
* </li>
55+
* <li>
56+
* <p>
57+
* <b>Directory bucket permissions</b> - To grant access to
58+
* this API operation, you must have the <code>s3express:PutMetricsConfiguration</code> permission in
59+
* an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource.
60+
* For more information about directory bucket policies and permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html">Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone</a> in the <i>Amazon S3 User Guide</i>.</p>
61+
* </li>
62+
* </ul>
63+
* </dd>
64+
* <dt>HTTP Host header syntax</dt>
65+
* <dd>
66+
* <p>
67+
* <b>Directory buckets </b> - The HTTP Host header syntax is <code>s3express-control.<i>region-code</i>.amazonaws.com</code>.</p>
68+
* </dd>
69+
* </dl>
3970
* <p>For information about CloudWatch request metrics for Amazon S3, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with Amazon CloudWatch</a>. </p>
4071
* <p>The following operations are related to <code>DeleteBucketMetricsConfiguration</code>:</p>
4172
* <ul>

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

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,46 @@ export interface GetBucketMetricsConfigurationCommandInput extends GetBucketMetr
2828
export interface GetBucketMetricsConfigurationCommandOutput extends GetBucketMetricsConfigurationOutput, __MetadataBearer {}
2929

3030
/**
31-
* <note>
32-
* <p>This operation is not supported for directory buckets.</p>
33-
* </note>
34-
* <p>Gets a metrics configuration (specified by the metrics configuration ID) from the bucket. Note that
31+
* <p>Gets a metrics configuration (specified by the metrics configuration ID) from the bucket. Note that
3532
* this doesn't include the daily storage metrics.</p>
36-
* <p> To use this operation, you must have permissions to perform the
37-
* <code>s3:GetMetricsConfiguration</code> action. The bucket owner has this permission by default. The
38-
* bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3
39-
* Resources</a>.</p>
33+
* <note>
34+
* <p>
35+
* <b>Directory buckets </b> - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i>
36+
* </code>. Virtual-hosted-style requests aren't supported.
37+
* For more information about endpoints in Availability Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/endpoint-directory-buckets-AZ.html">Regional and Zonal endpoints for directory buckets in Availability Zones</a> in the
38+
* <i>Amazon S3 User Guide</i>. For more information about endpoints in Local Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html">Concepts for directory buckets in Local Zones</a> in the
39+
* <i>Amazon S3 User Guide</i>.</p>
40+
* </note>
41+
* <dl>
42+
* <dt>Permissions</dt>
43+
* <dd>
44+
* <p> To use this operation, you must have permissions to perform the
45+
* <code>s3:GetMetricsConfiguration</code> action. The bucket owner has this permission by default. The
46+
* bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3
47+
* Resources</a>.</p>
48+
* <ul>
49+
* <li>
50+
* <p>
51+
* <b>General purpose bucket permissions</b> - The
52+
* <code>s3:GetMetricsConfiguration</code> permission is required in a policy. For more information
53+
* about general purpose buckets permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies and User
54+
* Policies</a> in the <i>Amazon S3 User Guide</i>.</p>
55+
* </li>
56+
* <li>
57+
* <p>
58+
* <b>Directory bucket permissions</b> - To grant access to
59+
* this API operation, you must have the <code>s3express:GetMetricsConfiguration</code> permission in
60+
* an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource.
61+
* For more information about directory bucket policies and permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html">Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone</a> in the <i>Amazon S3 User Guide</i>.</p>
62+
* </li>
63+
* </ul>
64+
* </dd>
65+
* <dt>HTTP Host header syntax</dt>
66+
* <dd>
67+
* <p>
68+
* <b>Directory buckets </b> - The HTTP Host header syntax is <code>s3express-control.<i>region-code</i>.amazonaws.com</code>.</p>
69+
* </dd>
70+
* </dl>
4071
* <p> For information about CloudWatch request metrics for Amazon S3, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with Amazon
4172
* CloudWatch</a>.</p>
4273
* <p>The following operations are related to <code>GetBucketMetricsConfiguration</code>:</p>

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

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,53 @@ export interface ListBucketMetricsConfigurationsCommandInput extends ListBucketM
2828
export interface ListBucketMetricsConfigurationsCommandOutput extends ListBucketMetricsConfigurationsOutput, __MetadataBearer {}
2929

3030
/**
31-
* <note>
32-
* <p>This operation is not supported for directory buckets.</p>
33-
* </note>
34-
* <p>Lists the metrics configurations for the bucket. The metrics configurations are only for the request
31+
* <p>Lists the metrics configurations for the bucket. The metrics configurations are only for the request
3532
* metrics of the bucket and do not provide information on daily storage metrics. You can have up to 1,000
3633
* configurations per bucket.</p>
34+
* <note>
35+
* <p>
36+
* <b>Directory buckets </b> - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i>
37+
* </code>. Virtual-hosted-style requests aren't supported.
38+
* For more information about endpoints in Availability Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/endpoint-directory-buckets-AZ.html">Regional and Zonal endpoints for directory buckets in Availability Zones</a> in the
39+
* <i>Amazon S3 User Guide</i>. For more information about endpoints in Local Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html">Concepts for directory buckets in Local Zones</a> in the
40+
* <i>Amazon S3 User Guide</i>.</p>
41+
* </note>
3742
* <p>This action supports list pagination and does not return more than 100 configurations at a time.
3843
* Always check the <code>IsTruncated</code> element in the response. If there are no more configurations
3944
* to list, <code>IsTruncated</code> is set to false. If there are more configurations to list,
4045
* <code>IsTruncated</code> is set to true, and there is a value in <code>NextContinuationToken</code>.
4146
* You use the <code>NextContinuationToken</code> value to continue the pagination of the list by passing
4247
* the value in <code>continuation-token</code> in the request to <code>GET</code> the next page.</p>
43-
* <p>To use this operation, you must have permissions to perform the
44-
* <code>s3:GetMetricsConfiguration</code> action. The bucket owner has this permission by default. The
45-
* bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3
46-
* Resources</a>.</p>
48+
* <dl>
49+
* <dt>Permissions</dt>
50+
* <dd>
51+
* <p>To use this operation, you must have permissions to perform the
52+
* <code>s3:GetMetricsConfiguration</code> action. The bucket owner has this permission by default. The
53+
* bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3
54+
* Resources</a>.</p>
55+
* <ul>
56+
* <li>
57+
* <p>
58+
* <b>General purpose bucket permissions</b> - The
59+
* <code>s3:GetMetricsConfiguration</code> permission is required in a policy. For more information
60+
* about general purpose buckets permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies and User
61+
* Policies</a> in the <i>Amazon S3 User Guide</i>.</p>
62+
* </li>
63+
* <li>
64+
* <p>
65+
* <b>Directory bucket permissions</b> - To grant access to
66+
* this API operation, you must have the <code>s3express:GetMetricsConfiguration</code> permission in
67+
* an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource.
68+
* For more information about directory bucket policies and permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html">Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone</a> in the <i>Amazon S3 User Guide</i>.</p>
69+
* </li>
70+
* </ul>
71+
* </dd>
72+
* <dt>HTTP Host header syntax</dt>
73+
* <dd>
74+
* <p>
75+
* <b>Directory buckets </b> - The HTTP Host header syntax is <code>s3express-control.<i>region-code</i>.amazonaws.com</code>.</p>
76+
* </dd>
77+
* </dl>
4778
* <p>For more information about metrics configurations and CloudWatch request metrics, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with
4879
* Amazon CloudWatch</a>.</p>
4980
* <p>The following operations are related to <code>ListBucketMetricsConfigurations</code>:</p>
@@ -135,6 +166,7 @@ export class ListBucketMetricsConfigurationsCommand extends $Command
135166
>()
136167
.ep({
137168
...commonParams,
169+
UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
138170
Bucket: { type: "contextParams", name: "Bucket" },
139171
})
140172
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {

0 commit comments

Comments
 (0)