Skip to content

Functions can try to create EventBridgeRules with invalid target IDs #1742

@farski

Description

@farski

Description:

When creating an Lambda function with inline EventBridgeRule events, the target property of the translated rules use an ID value of self.logical_id + "LambdaTarget". Logical ID in this case is the logical ID of function itself, concat the name given to the event. So if those two things combine to more than ~52 characters, the attempt to create the rule will fail with an invalid id.

Steps to reproduce the issue:

  1. Create a function with a resource name like CdPipelineEventsTargetLambdaFunction
  2. Add an event with a name like ActionsEventsRule

Observed result:

1 validation error detected: Value 'CdPipelineEventsTargetLambdaFunctionActionsEventsRuleLambdaTarget' at 'targets.1.member.id' failed to satisfy constraint: Member must have length less than or equal to 64 (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID: d7368367-3408-45ba-a8d2-8117e4c5e771; Proxy: null)

Expected result:

Some sort of truncation, I guess, to ensure that the rule can be created

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