interface ObjectCreatedProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.S3.Events.BucketEvents.ObjectCreated.ObjectCreatedProps |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awss3/events#BucketEvents_ObjectCreated_ObjectCreatedProps |
Java | software.amazon.awscdk.mixins.preview.services.s3.events.BucketEvents.ObjectCreated.ObjectCreatedProps |
Python | aws_cdk.mixins_preview.aws_s3.events.BucketEvents.ObjectCreated.ObjectCreatedProps |
TypeScript | @aws-cdk/mixins-preview ยป aws_s3 ยป events ยป BucketEvents ยป ObjectCreated ยป ObjectCreatedProps |
Props type for Bucket aws.s3@ObjectCreated event.
Example
import { BucketEvents } from '@aws-cdk/mixins-preview/aws-s3/events';
import * as events from 'aws-cdk-lib/aws-events';
import * as targets from 'aws-cdk-lib/aws-events-targets';
// Works with L2 constructs
const bucket = new s3.Bucket(scope, 'Bucket');
const bucketEvents = BucketEvents.fromBucket(bucket);
declare const fn: lambda.Function;
new events.Rule(scope, 'Rule', {
eventPattern: bucketEvents.objectCreatedPattern({
object: { key: ['uploads/*'] }
}),
targets: [new targets.LambdaFunction(fn)]
});
// Also works with L1 constructs
const cfnBucket = new s3.CfnBucket(scope, 'CfnBucket');
const cfnBucketEvents = BucketEvents.fromBucket(cfnBucket);
new events.CfnRule(scope, 'CfnRule', {
state: 'ENABLED',
eventPattern: cfnBucketEvents.objectCreatedPattern({
object: { key: ['uploads/*'] }
}),
targets: [{ arn: fn.functionArn, id: 'L1' }]
});
Properties
| Name | Type | Description |
|---|---|---|
| bucket? | Bucket | bucket property. |
| event | AWSEvent | EventBridge event metadata. |
| object? | Object | object property. |
| reason? | string[] | reason property. |
| request | string[] | request-id property. |
| requester? | string[] | requester property. |
| source | string[] | source-ip-address property. |
| version? | string[] | version property. |
bucket?
Type:
Bucket
(optional, default: Do not filter on this field)
bucket property.
Specify an array of string values to match this event if the actual value of bucket is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.
eventMetadata?
Type:
AWSEvent
(optional, default: -)
EventBridge event metadata.
object?
Type:
Object
(optional, default: Do not filter on this field)
object property.
Specify an array of string values to match this event if the actual value of object is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.
reason?
Type:
string[]
(optional, default: Do not filter on this field)
reason property.
Specify an array of string values to match this event if the actual value of reason is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.
requestId?
Type:
string[]
(optional, default: Do not filter on this field)
request-id property.
Specify an array of string values to match this event if the actual value of request-id is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.
requester?
Type:
string[]
(optional, default: Do not filter on this field)
requester property.
Specify an array of string values to match this event if the actual value of requester is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.
sourceIpAddress?
Type:
string[]
(optional, default: Do not filter on this field)
source-ip-address property.
Specify an array of string values to match this event if the actual value of source-ip-address is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.
version?
Type:
string[]
(optional, default: Do not filter on this field)
version property.
Specify an array of string values to match this event if the actual value of version is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.

.NET
Go
Java
Python
TypeScript