aws / aws/aws-cdk

aws-s3: eventBridgeEnabled not working as expected.

Open
#26,772 11 comments 8 reactions 0 assignees View on GitHub
@aws-cdk/aws-s3 bug effort/medium p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

Take this simple example :

`
const bucket = new s3.Bucket(this, 'MyEventBridgeBucket', {
eventBridgeEnabled: true,
});
`

CDK is supposed to enable only event bridge notification. It is available on UI as "Send notifications to Amazon EventBridge for all events in this bucket" but instead CDK is creating IAM role + Policy, Lambda function which I have not defined anywhere and do not want.

### Expected Behavior

Expected behaviour should be S3 bucket creation with event bridge notification enabled without extra IAM/Lambda resource creations.

### Current Behavior

It is creating extra resources like IAM role+policy, Lambda function which is not mentioned and required to enable event bridge notification.

### Reproduction Steps

Create new bucket with below code:

`
const bucket = new s3.Bucket(this, 'MyEventBridgeBucket', {
eventBridgeEnabled: true,
});
`

You will be able to see extra resources in cloud formation.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

4.0

### Framework Version

^2.17.0

### Node.js Version

18

### OS

mac OS 13.4

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with an s3.Bucket configured with eventBridgeEnabled: true, then inspect the synthesized CloudFormation template to identify why IAM and Lambda resources appear. Done means the bucket has EventBridge notifications enabled without those extra resources, with the relevant CDK behavior covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.