# NotificationKeyFilter

- Source: [`aws-s3/lib/bucket.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L3719)

## Example

```ts
   declare const myLambda: lambda.Function;
   const bucket = new s3.Bucket(this, 'MyBucket');
   const filter: s3.NotificationKeyFilter = { prefix: 'home/myusername/*' };
   bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(myLambda), filter);
```

## Properties

- `prefix`: string — S3 keys must have the specified prefix.

- `suffix`: string — S3 keys must have the specified suffix.
