# MetricsConfigurationProperty

Struct · External

Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.

If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For examples, see [AWS::S3::Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples) . For more information, see [PUT Bucket metrics](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html) in the *Amazon S3 API Reference* .

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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';
const metricsConfigurationProperty: s3.CfnBucket.MetricsConfigurationProperty = {
  id: 'id',

  // the properties below are optional
  accessPointArn: 'accessPointArn',
  prefix: 'prefix',
  tagFilters: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```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

metrics_configuration_property = s3.CfnBucket.MetricsConfigurationProperty(
    id="id",

    # the properties below are optional
    access_point_arn="accessPointArn",
    prefix="prefix",
    tag_filters=[s3.CfnBucket.TagFilterProperty(
        key="key",
        value="value"
    )]
)
```

Java:

```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.*;

MetricsConfigurationProperty metricsConfigurationProperty = MetricsConfigurationProperty.builder()
        .id("id")

        // the properties below are optional
        .accessPointArn("accessPointArn")
        .prefix("prefix")
        .tagFilters(List.of(TagFilterProperty.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C#:

```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 metricsConfigurationProperty = new MetricsConfigurationProperty {
    Id = "id",

    // the properties below are optional
    AccessPointArn = "accessPointArn",
    Prefix = "prefix",
    TagFilters = new [] { new TagFilterProperty {
        Key = "key",
        Value = "value"
    } }
};
```

Go:

```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"

metricsConfigurationProperty := &MetricsConfigurationProperty{
	Id: jsii.String("id"),

	// the properties below are optional
	AccessPointArn: jsii.String("accessPointArn"),
	Prefix: jsii.String("prefix"),
	TagFilters: []interface{}{
		&TagFilterProperty{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `accessPointArn`: string — The access point that was used while performing operations on the object.

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

- `id`: string (required) — The ID used to identify the metrics configuration.

  This can be any value you choose that helps you identify your metrics configuration.

- `prefix`: string — The prefix that an object must have to be included in the metrics results.

- `tagFilters`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnBucket.TagFilterProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.TagFilterProperty.html)[] — 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.
