-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(SelfManagedKafkaEventSource): cannot update existing trigger #26416
Comments
I don't see a reason why this should cause a logical ID to change like this. If you create the lambda event sources and then add them to the lambda function, does this behavior replicate? |
do you mean like this? props.topics.forEach((topic: string) => {
const a = new SelfManagedKafkaEventSource({ ... })
lambda.addEventSource( a )
}) this is actually how my code is, i just simplified it for brevity for this post ... do you think it makes a difference? i could try both |
i think this is related aws/serverless-application-model#1320 (comment) i will need to do more investigation to see if this is CDK or CFN issue |
That does seem to point at the possibility of it being a service/cloudformation related issue. |
This also appears to affect Terraform. The workaround is using the AWS SDK/CLI to remove the "broken" handler and then re-apply. |
Topics field cannot be updated: https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateEventSourceMapping.html#API_UpdateEventSourceMapping_RequestSyntax Going from one topic to another should work as long as no other trigger is using the same combination of event source + function + topic. This requires a new trigger to be created. Edit: I misread the code, I see now that it is adding two separate triggers. In this case the first trigger should not be updated and the second trigger should be added, so there does appear to be an issue. Did the bootstrap servers, function, or topic for the first trigger change between deployments? |
Checking in - are there any updates on this issue, or have you tried testing in a more recent version? |
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. |
Describe the bug
When using Lambda +
SelfManagedKafkaEventSource
, I'm having trouble updating the stack as it attempts to deploy a new trigger, instead of updating the existing one.(Forgive me, i'm new to CDK and am unsure how logical ID's work)
I have an array of topics i want to subscribe to and have first deployed with just 1 array, then 2, but on second deploy it fails (see below)
eg. imagine the topics array as:
how are logical ID's created and why does it create a new one?
Expected Behavior
update existing trigger
Current Behavior
on first deploy it creates a trigger with logical ID:
but on second deploy it attempts to create a new trigger with logical ID:
which fails with:
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.78.0 (build 8e95c37)
Framework Version
No response
Node.js Version
v18.15.0
OS
Windows WSL + Ubuntu 20
Language
Typescript
Language Version
TypeScript 5
Other information
No response
The text was updated successfully, but these errors were encountered: