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
(aws-cdk-lib.aws_s3_notifications): (Configuration is ambigously defined even through prefixes are not overlapping) #29951
Comments
@thenamanpatwari Good morning. Please share the following:
Using the below CDK TypeScript code, I was able to deploy CF stack (first deploying one event notification and then another one as part of same stack): import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as s3n from 'aws-cdk-lib/aws-s3-notifications'
export class TypescriptStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const lambdaFunction = new lambda.Function(this, 'TestLambdaFunction',{
runtime: lambda.Runtime.NODEJS_18_X,
code: lambda.Code.fromAsset('lambda'),
handler: 'hello.handler'
});
const s3Bucket = new s3.Bucket(this, 'TestBucket');
s3Bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(lambdaFunction), { prefix: "bounding_box_2d/" });
s3Bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(lambdaFunction), { prefix: "kv_rule_engine/input/" });
}
}
const app = new cdk.App();
new TypescriptStack(app, 'TypescriptStack'); Thereafter, when I upload an object to S3, I see no error in the CloudWatch logs for BucketNotificationsHandler created by CDK stack (runtime Python):
Thanks, |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Thank you for your response Ashish.
|
I'm having the same issue, with the below changes
cdk version 2.139.1 (build b88f959) stack is failing with the below:
|
@airmonitor Thank you for the detailed description. Can confirm I am getting the same error. |
@ashishdhingra any updates? This is blocking some of our critical deployments. |
@thenamanpatwari As mentioned in the #29951 (comment), I'm unable to reproduce the issue. Please share the sample end-to-end code (including Python code for your lambda function) and any other configuration that needs to be done, to reproduce the issue. From the error in the issue description, it appears that you have overlapping prefixes for the same event type. You also mentioned that there are lot of prefixes already defined. Are these defined for same event type? Also the error in the issue description appears to be in Lambda event handler, looks like it is reported when the Lambda is invoked per event notification, not when CDK stack is deployed. Kindly correct if I'm wrong. Kindly note that once the CDK deployment is initiated, it is CloudFormation that takes over. Thanks, |
Describe the bug
The S3 notification module is throwing an configuration is ambiguously defined error even though the prefixes do not overlap. This issue is resolved if I remove all currently defined notifications and re-add them along with the new one.
Example code
Expected Behavior
I expect the relevant event notifications to be created on the relevant S3 bucket
Current Behavior
CloudFromation is throwing an error
Reproduction Steps
Possible Solution
No response
Additional Information/Context
Recently upgraded to "aws-cdk-lib": "^2.138.0" which might be causing this issue
CDK CLI Version
2.138.0
Framework Version
No response
Node.js Version
10.8.1
OS
Linux
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: