ObjectCreated

class aws_cdk.mixins_preview.aws_s3.events.ObjectCreated

Bases: object

(experimental) EventBridge event pattern for aws.s3@ObjectCreated.

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_s3 import events as s3_events

object_created = s3_events.ObjectCreated()
Stability:

experimental

Static Methods

classmethod object_created_pattern(*, bucket=None, event_metadata=None, object=None, reason=None, requester=None, request_id=None, source_ip_address=None, version=None)

(experimental) EventBridge event pattern for Object Created.

Parameters:
  • bucket (Union[Bucket, Dict[str, Any], None]) – (experimental) 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. Default: - Do not filter on this field

  • event_metadata (Union[AWSEventMetadataProps, Dict[str, Any], None]) – (experimental) EventBridge event metadata. Default: - -

  • object (Union[ObjectType, Dict[str, Any], None]) – (experimental) 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. Default: - Do not filter on this field

  • reason (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • requester (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • request_id (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • source_ip_address (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • version (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

Stability:

experimental

Return type:

EventPattern

Bucket

class ObjectCreated.Bucket(*, name=None)

Bases: object

(experimental) Type definition for Bucket.

Parameters:

name (Optional[Sequence[str]]) – (experimental) name property. Specify an array of string values to match this event if the actual value of name is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options. Default: - Filter with the Bucket reference

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_s3 import events as s3_events

bucket = s3_events.ObjectCreated.Bucket(
    name=["name"]
)

Attributes

name

(experimental) name property.

Specify an array of string values to match this event if the actual value of name is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.

Default:
  • Filter with the Bucket reference

Stability:

experimental

ObjectCreatedProps

class ObjectCreated.ObjectCreatedProps(*, bucket=None, event_metadata=None, object=None, reason=None, requester=None, request_id=None, source_ip_address=None, version=None)

Bases: object

(experimental) Props type for aws.s3@ObjectCreated event.

Parameters:
  • bucket (Union[Bucket, Dict[str, Any], None]) – (experimental) 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. Default: - Do not filter on this field

  • event_metadata (Union[AWSEventMetadataProps, Dict[str, Any], None]) – (experimental) EventBridge event metadata. Default: - -

  • object (Union[ObjectType, Dict[str, Any], None]) – (experimental) 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. Default: - Do not filter on this field

  • reason (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • requester (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • request_id (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • source_ip_address (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

  • version (Optional[Sequence[str]]) – (experimental) 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. Default: - Do not filter on this field

Stability:

experimental

ExampleMetadata:

infused

Example:

from aws_cdk.mixins_preview.aws_s3.events.ObjectType import ObjectType, ObjectType
from aws_cdk.mixins_preview.aws_s3.events import BucketEvents
import aws_cdk.aws_events as events
import aws_cdk.aws_events_targets as targets
# fn: lambda.Function


# Works with L2 constructs
my_bucket = s3.Bucket(scope, "Bucket")
bucket_events = BucketEvents.from_bucket(my_bucket)

events.Rule(scope, "Rule",
    event_pattern=bucket_events.object_created_pattern(
        object=ObjectType(key=events.Match.wildcard("uploads/*"))
    ),
    targets=[targets.LambdaFunction(fn)]
)

# Also works with L1 constructs
cfn_bucket = s3.CfnBucket(scope, "CfnBucket")
cfn_bucket_events = BucketEvents.from_bucket(cfn_bucket)

events.CfnRule(scope, "CfnRule",
    state="ENABLED",
    event_pattern=cfn_bucket_events.object_created_pattern(
        object=ObjectType(key=events.Match.wildcard("uploads/*"))
    ),
    targets=[events.CfnRule.TargetProperty(arn=fn.function_arn, id="L1")]
)

Attributes

bucket

(experimental) 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.

Default:
  • Do not filter on this field

Stability:

experimental

event_metadata

(experimental) EventBridge event metadata.

Default:

Stability:

experimental

object

(experimental) 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.

Default:
  • Do not filter on this field

Stability:

experimental

reason

(experimental) 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.

Default:
  • Do not filter on this field

Stability:

experimental

request_id

(experimental) 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.

Default:
  • Do not filter on this field

Stability:

experimental

requester

(experimental) 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.

Default:
  • Do not filter on this field

Stability:

experimental

source_ip_address

(experimental) 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.

Default:
  • Do not filter on this field

Stability:

experimental

version

(experimental) 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.

Default:
  • Do not filter on this field

Stability:

experimental

ObjectType

class ObjectCreated.ObjectType(*, etag=None, key=None, sequencer=None, size=None, version_id=None)

Bases: object

(experimental) Type definition for Object.

Parameters:
  • etag (Optional[Sequence[str]]) – (experimental) etag property. Specify an array of string values to match this event if the actual value of etag is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options. Default: - Do not filter on this field

  • key (Optional[Sequence[str]]) – (experimental) key property. Specify an array of string values to match this event if the actual value of key is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options. Default: - Do not filter on this field

  • sequencer (Optional[Sequence[str]]) – (experimental) sequencer property. Specify an array of string values to match this event if the actual value of sequencer is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options. Default: - Do not filter on this field

  • size (Optional[Sequence[str]]) – (experimental) size property. Specify an array of string values to match this event if the actual value of size is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options. Default: - Do not filter on this field

  • version_id (Optional[Sequence[str]]) – (experimental) version-id property. Specify an array of string values to match this event if the actual value of version-id is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options. Default: - Do not filter on this field

Stability:

experimental

ExampleMetadata:

infused

Example:

from aws_cdk.mixins_preview.aws_s3.events.ObjectType import ObjectType, ObjectType
from aws_cdk.mixins_preview.aws_s3.events import BucketEvents
import aws_cdk.aws_events as events
import aws_cdk.aws_events_targets as targets
# fn: lambda.Function


# Works with L2 constructs
my_bucket = s3.Bucket(scope, "Bucket")
bucket_events = BucketEvents.from_bucket(my_bucket)

events.Rule(scope, "Rule",
    event_pattern=bucket_events.object_created_pattern(
        object=ObjectType(key=events.Match.wildcard("uploads/*"))
    ),
    targets=[targets.LambdaFunction(fn)]
)

# Also works with L1 constructs
cfn_bucket = s3.CfnBucket(scope, "CfnBucket")
cfn_bucket_events = BucketEvents.from_bucket(cfn_bucket)

events.CfnRule(scope, "CfnRule",
    state="ENABLED",
    event_pattern=cfn_bucket_events.object_created_pattern(
        object=ObjectType(key=events.Match.wildcard("uploads/*"))
    ),
    targets=[events.CfnRule.TargetProperty(arn=fn.function_arn, id="L1")]
)

Attributes

etag

(experimental) etag property.

Specify an array of string values to match this event if the actual value of etag is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.

Default:
  • Do not filter on this field

Stability:

experimental

key

(experimental) key property.

Specify an array of string values to match this event if the actual value of key is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.

Default:
  • Do not filter on this field

Stability:

experimental

sequencer

(experimental) sequencer property.

Specify an array of string values to match this event if the actual value of sequencer is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.

Default:
  • Do not filter on this field

Stability:

experimental

size

(experimental) size property.

Specify an array of string values to match this event if the actual value of size is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.

Default:
  • Do not filter on this field

Stability:

experimental

version_id

(experimental) version-id property.

Specify an array of string values to match this event if the actual value of version-id is one of the values in the array. Use one of the constructors on the aws_events.Match for more advanced matching options.

Default:
  • Do not filter on this field

Stability:

experimental