New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: S3 bucket.add_event_notification() does not deploy #9352
Comments
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our contributing guide. |
I believe I experienced the same issue. I shared many new helpful details about it in the Slack channel: https://localstack-community.slack.com/archives/CMAFN2KSP/p1701200973470049 Any progress was made on this topic? We would like to purchase Pro licenses for the company but when trying to run our CDK it breaks and is currently a blocker for the purchase. |
Same here! Please fix ASAP, this is critical functionality. |
CDK adds a "custom resource" to handle the notification "glue" (so to speak). Custom resources are only available in LocalStack Pro, no the free version. Here's a hack to bypass the custom resource created by CDK. We can access the underlying L1 CDK construct, and from there set This example is in TypeScript. const bucket = new s3.Bucket(...);
const lambda = new NodejsFunction(...);
if (isDeployingToLocalStack()) { // implement or replace `isDeployingToLocalStack()` as required
const cfnBucket = bucket.node.defaultChild as s3.CfnBucket;
cfnBucket.notificationConfiguration = {
lambdaConfigurations: [
{
creationStack: [],
event: 's3:ObjectCreated:*',
function: lambda.functionArn,
},
],
};
} This works for newly created S3 and Lambda resources. I don't know what impact it'll have if you bypass the inline Python script added by CDK. (In the worst case scenario, you can add your own.) |
Hello and thanks for the report. As it has been answered in the linked issue and by @laurence-myers who provided a nice workaround, CDK will create a Custom Resource which is Pro only. By using the workaround, you should be able to get it working with community. I'll close the issue as this has been answered. Thanks a lot! |
Is there an existing issue for this?
Current Behavior
(CDK Local)
I opened a ticket here, but there has been no investigation.
Issue initially depicted here: localstack/aws-cdk-local#88
As the title suggests, calling add_event_notification() with any target results in the following error as seen towards the end of the log file:
localstack.log
Expected Behavior
If I set the notification through awslocal cli:
all my code works properly.
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
Code
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: