Skip to content
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

Eventbridge Events Names do not match the Lambda Name Pattern #2135

Open
ArielZamparini-REISys opened this issue Feb 21, 2025 · 0 comments
Open

Comments

@ArielZamparini-REISys
Copy link

Problem is super simple but this affects running two of the same chalice apps in the same AWS Account.

If I create a new function with a 'Rate' to apply a regular schedule

@upload_private.schedule(Rate(3, unit=Rate.MINUTES)) def process_uploads(event):

And my Chalice config has an app name

...version = "2.0" app_name = "dev-backend" autogen_policy = false stages = { app = { api_gateway_stage = "api" environment_variables = {...

Then correctly chalice will create a lambda function with the name:

"dev-backend-process_uploads"

Fantastic so if I create another app with the app_name = "stage-backend" the lambda function becomes

"stage-backend-process_uploads"

Sweet! they are different and do not conflict... However in order to create that lambda trigger chalice has to make an eventbridge event (aka cloudwatch event) in order to start that code on the schedule requested.

This is where the bug is, for some reason the current latest version of chalice creates the name in eventbridge as ONLY the function name and drops the app name completely. So if these two apps deploy they will fight for this asset back and forth.

Example problematic cloudwatch/eventbridge event name:
"process_uploads"

Can you please fix it so that the name for the lambda function matches the name in the event trigger? Basically append appname+functionname to avoid conflicts in the name?
Its probably a one line change somewhere but I am not a python expert so I am lacking the knowledge to create a PR.

FYI: In my use-case I am using the terraform package output and I am not sure if the problem lies there.

Helpful hint we are looking for the section of the code that creates the AWS "aws_cloudwatch_event_rule" object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant