Skip to content

s3: allow defining bucket notifications for unowned buckets #2004

@amirsch

Description

@amirsch

The use case is fairly simple, creating a new lambda function and attaching an event source from an existing S3 bucket of object creation.

following example code:

   const exampleBucket = Bucket.import(this, 'example-bucket', {bucketArn: 'arn:aws:s3:::example-bucket-arn'});
   fn.addEventSource(new S3EventSource(exampleBucket, { events: [EventType.ObjectCreated] }));

This code has a type mismatch (ImportedBucket vs Bucket), and doesn't work regardless.
Is there another way to use an existing bucket for an S3 event source?

Additional 2x👍 from duplicated issues

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-s3Related to Amazon S3@aws-cdk/aws-s3-notificationseffort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.feature/enhancementA new API to make things easier or more intuitive. A catch-all for general feature requests.in-progressThis issue is being actively worked on.management/roadmapRelated to project public timeline/roadmapp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions