enable eventBridge prop on S3 bucket via CDK
Hi team,
I want to enable eventBridge notification on my S3 bucket via CDK,
I saw it was added as a property to the bucket props as part of this PR :
https://github.com/aws/aws-cdk/pull/18150
but I can't find it on the props
import { BlockPublicAccess, Bucket} from "@aws-cdk/aws-s3";
const myS3Bucket= new Bucket(
this,
"myS3Bucket",
{
versioned: false,
publicReadAccess: false,
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
eventBridgeEnabled: true, -- error here .....
}
);
I have this error :
eventBridgeEnabled: boolean; }' is not assignable to parameter of type 'BucketProps'.
I even tried with CfnBucket but had same error
const bucket = new CfnBucket(this, 'MyEventBridgeBucket', {
eventBridgeEnabled: true,
});
Argument of type '{ eventBridgeEnabled: boolean; }' is not assignable to parameter of type 'CfnBucketProps'.
Object literal may only specify known properties, and 'eventBridgeEnabled' does not exist in type 'CfnBucketProps'
I want to simply to add it in my first declaration so I can keep those properties :
versioned: false,
publicReadAccess: false,
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
how can I enable eventBridge on my S3 bucket via CDK ?
Thank you!
Hello there!
Please check what version of aws-cdk-lib you are using (e.g. with npm list | grep cdk
)
According to CDK releases the change you are looking for (adding prop to enable EventBridge in S3 BucketProps #18076) is available since:
- v2.20.0 for CDK v2
- v1.152.0 for CDK v1
Relevant questions
S3 object lock on existing S3 objects?
Accepted AnswerHow to determine if an object is encrypted with a "regular" S3-SSE KMS key, or an S3 Bucket Key with S3 Inventory?
Accepted Answerasked a year agoS3 file drop fire multiple Lambdas
Accepted Answerasked 3 years agoAccess denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfront
asked 6 months agoCDK AWS trigger with type EVENT
asked a month agoS3 Glacier (2013) Flexible running without Bucket, want to move to Glacier Deep Archive
asked 25 days agoAccess to Public S3 within private subnet in VPC without Internet
asked 3 years agoenable eventBridge prop on S3 bucket via CDK
asked a month agoenable Amazon EventBridge for s3 bucket via CDK
Accepted Answerasked a month agoS3: Configure object lock with replication (CRR) on aws s3 buckets
asked 24 days ago