Skip to content

BucketLambdaSubscriber

Reference doc for the `sst.aws.BucketLambdaSubscriber` component.

The BucketLambdaSubscriber component is internally used by the Bucket component to add bucket notifications to AWS S3 Bucket.

You’ll find this component returned by the subscribe method of the Bucket component.


Constructor

new BucketLambdaSubscriber(name, args, opts?)

Parameters

Properties

nodes

Type Object

The underlying resources this component creates.

nodes.notification

Type BucketNotification

The S3 bucket notification.

nodes.permission

Type Permission

The Lambda permission.

nodes.function

Type Output<Function>

The Lambda function that’ll be notified.

Args

bucket

Type Input<Object>

The bucket to use.

bucket.arn

Type Input<string>

The ARN of the bucket.

bucket.name

Type Input<string>

The name of the bucket.

events?

Type Input<Input<s3:ObjectCreated:* | s3:ObjectCreated:Put | s3:ObjectCreated:Post | s3:ObjectCreated:Copy | s3:ObjectCreated:CompleteMultipartUpload | s3:ObjectRemoved:* | s3:ObjectRemoved:Delete | s3:ObjectRemoved:DeleteMarkerCreated | s3:ObjectRestore:* | s3:ObjectRestore:Post | s3:ObjectRestore:Completed | s3:ObjectRestore:Delete | s3:ReducedRedundancyLostObject | s3:Replication:* | s3:Replication:OperationFailedReplication | s3:Replication:OperationMissedThreshold | s3:Replication:OperationReplicatedAfterThreshold | s3:Replication:OperationNotTracked | s3:LifecycleExpiration:* | s3:LifecycleExpiration:Delete | s3:LifecycleExpiration:DeleteMarkerCreated | s3:LifecycleTransition | s3:IntelligentTiering | s3:ObjectTagging:* | s3:ObjectTagging:Put | s3:ObjectTagging:Delete | s3:ObjectAcl:Put>[]>

Default All S3 events

A list of S3 event types that’ll trigger the notification.

{
events: ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"]
}

filterPrefix?

Type Input<string>

An S3 object key prefix that will trigger the notification.

To filter for all the objects in the images/ folder.

{
filterPrefix: "images/"
}

filterSuffix?

Type Input<string>

An S3 object key suffix that will trigger the notification.

To filter for all the objects with the .jpg suffix.

{
filterSuffix: ".jpg"
}

subscriber

Type Input<string | FunctionArgs>

The subscriber function.

subscriberId

Type Input<string>

The subscriber ID.

transform?

Type Object

Transform how this notification creates its underlying resources.

transform.notification?

Type BucketNotificationArgs | (args: BucketNotificationArgs, opts: ComponentResourceOptions, name: string) => void

Transform the S3 Bucket Notification resource.