# S3KeyFilterProperty

A container for object key name prefix and suffix filtering rules.

For more information about object key name filtering, see [Configuring event notifications using object key name filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the *Amazon S3 User Guide* .

> The same type of filter rule cannot be used more than once. For example, you cannot specify two prefix rules.

- 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 s3KeyFilterProperty: s3.CfnBucket.S3KeyFilterProperty = {
  rules: [{
    name: 'name',
    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

s3_key_filter_property = s3.CfnBucket.S3KeyFilterProperty(
    rules=[s3.CfnBucket.FilterRuleProperty(
        name="name",
        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.*;

S3KeyFilterProperty s3KeyFilterProperty = S3KeyFilterProperty.builder()
        .rules(List.of(FilterRuleProperty.builder()
                .name("name")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```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 s3KeyFilterProperty = new S3KeyFilterProperty {
    Rules = new [] { new FilterRuleProperty {
        Name = "name",
        Value = "value"
    } }
};
```

Golang:

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

s3KeyFilterProperty := &S3KeyFilterProperty{
	Rules: []interface{}{
		&FilterRuleProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `rules`: [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.FilterRuleProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.FilterRuleProperty.html)[] (required) — A list of containers for the key-value pair that defines the criteria for the filter rule.
