Skip to content

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

@ArielZamparini-REISys

Description

@ArielZamparini-REISys

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions