Skip to content

(aws-events): Automatically Generated JobName Must Be Shorter Than 128 Char Long #24654

@akefirad

Description

@akefirad

Describe the bug

In AWS::Events::Rule, BatchParameters, the JobName must be shorter than 128 character long. Otherwise it fails with:

Parameter JobName is not valid. Reason: Length must be in between 1 and 128. (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID: 1234567890; Proxy: null)

Expected Behavior

Ideally BatchJob (in aws-events-targets) should generate a shorter name, or the very least the name should be checked in events.Rule to fail during synth phase.

Current Behavior

It fails during deployment.

Reproduction Steps

My stack is pretty big, so not sure, but I guess creating a stack with longer name and leave it to CDK to generate the BatchJob.jobName should be enough to reproduce it. Let me know if you need a sample project.

Possible Solution

Ideally BatchJob (in aws-events-targets) should generate a shorter name, or the very least the name should be checked in events.Rule to fail during synth phase.

Additional Information/Context

Interestingly there's no such requirement on CFN documentation.

CDK CLI Version

2.69.0

Framework Version

No response

Node.js Version

18

OS

MacOS

Language

Typescript

Language Version

4.9.0

Other information

Happy to send a PR if I know how to fix it. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-eventsRelated to CloudWatch EventsbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions