Skip to content
v2.278.0

BucketMetrics Struct ​

Specifies a metrics configuration for the CloudWatch request metrics from an Amazon S3 bucket.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const tagFilters: any;
const bucketMetrics: s3.BucketMetrics = {
  id: 'id',

  // the properties below are optional
  prefix: 'prefix',
  tagFilters: {
    tagFiltersKey: tagFilters,
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_s3 as s3

# tag_filters: Any

bucket_metrics = s3.BucketMetrics(
    id="id",

    # the properties below are optional
    prefix="prefix",
    tag_filters={
        "tag_filters_key": tag_filters
    }
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.s3.*;

Object tagFilters;

BucketMetrics bucketMetrics = BucketMetrics.builder()
        .id("id")

        // the properties below are optional
        .prefix("prefix")
        .tagFilters(Map.of(
                "tagFiltersKey", tagFilters))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.S3;

var tagFilters;

var bucketMetrics = new BucketMetrics {
    Id = "id",

    // the properties below are optional
    Prefix = "prefix",
    TagFilters = new Dictionary<string, object> {
        { "tagFiltersKey", tagFilters }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var tagFilters interface{}

bucketMetrics := &BucketMetrics{
	Id: jsii.String("id"),

	// the properties below are optional
	Prefix: jsii.String("prefix"),
	TagFilters: map[string]interface{}{
		"tagFiltersKey": tagFilters,
	},
}

Properties ​

idstringidstridStringIdstringId*string required #
The ID used to identify the metrics configuration.
prefixoptionalstringprefixoptionalstrprefixoptionalStringPrefixoptionalstringPrefixoptional*string #
The prefix that an object must have to be included in the metrics results.
tagFiltersoptional{ [key: string]: any }tag_filtersoptionaltyping.Mapping[str, Any]tagFiltersoptionalMap<String, Object>TagFiltersoptionalIDictionary<string, object>TagFiltersoptional*map[string]interface{} #
Specifies a list of tag filters to use as a metrics configuration filter.

The metrics configuration includes only objects that meet the filter's criteria.