Skip to content

(aws-events): EventBus no longer generates a name if needed #18070

@ChrisSargent

Description

@ChrisSargent

What is the problem?

Before v1.29.0, when creating an EventBus without giving a specified name, cdk would generate one automatically (or if using cdk.physicalName.GENERATE_IF_NEEDED

A change made in v1.29.0 here, changed that behaviour: 707fa00#diff-e578aba9e8d0d3ee80700fb06d4ab56133d869f88887efd65941d6e2e90bec98

The 'offending' line seems to be line 280 where the addition return was added.

Reproduction Steps

I have create a minimal reproduction here:

Working version: https://github.com/ChrisSargent/cdk-issues/tree/cdkv1-working

Failing version: https://github.com/ChrisSargent/cdk-issues/tree/cdkv1-failing

Diff showing only package versions changed:ChrisSargent/cdk-issues@cdkv1-working...cdkv1-failing

FYI commenting lines 279 - 281 'fixes' this particular issue but I'm not sure if that is the right long-term fix.

What did you expect to happen?

The physical name to be generated

What actually happened?

Synth Errors:

/cdk-issues/node_modules/@aws-cdk/core/lib/runtime.ts:134
      throw new CfnSynthesisError(message);
            ^
Error: Resolution error: Supplied properties not correct for "CfnEventBusProps"
  name: required but missing.
    at ValidationResult.assertSuccess (/cdk-issues/node_modules/@aws-cdk/core/lib/runtime.ts:134:13)
    at cfnEventBusPropsToCloudFormation (/cdk-issues/node_modules/@aws-cdk/aws-events/lib/events.generated.ts:523:43)
    at CfnEventBus.renderProperties (/cdk-issues/node_modules/@aws-cdk/aws-events/lib/events.generated.ts:608:16)
    at PostResolveToken.ret.Resources [as processor] (/cdk-issues/node_modules/@aws-cdk/core/lib/cfn-resource.ts:226:40)
    at PostResolveToken.postProcess (/cdk-issues/node_modules/@aws-cdk/core/lib/util.ts:92:17)
    at Object.postProcess (/cdk-issues/node_modules/@aws-cdk/core/lib/private/resolve.ts:122:78)
    at DefaultTokenResolver.resolveToken (/cdk-issues/node_modules/@aws-cdk/core/lib/resolvable.ts:84:32)
    at resolve (/cdk-issues/node_modules/@aws-cdk/core/lib/private/resolve.ts:212:51)
    at Object.resolve (/cdk-issues/node_modules/@aws-cdk/core/lib/private/resolve.ts:119:77)
    at resolve (/cdk-issues/node_modules/@aws-cdk/core/lib/private/resolve.ts:230:47)
Subprocess exited with error 1

CDK CLI Version

1.129.0

Framework Version

No response

Node.js Version

14

OS

MacOs

Language

Typescript

Language Version

No response

Other information

Original PR: #17008

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 effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions