Skip to content

aws-events: Archive construct does not have defaultChild set #21263

@Gtofig

Description

@Gtofig

Describe the bug

Archive construct has defaultChild as undefined instead of an instance of CfnArchive

Expected Behavior

I expect archive.node.defaultChild to return instance of CfnArchive, but it is currently undefined

Current Behavior

archive.node.defaultChild returns undefined

Reproduction Steps

const app = new App();
const stack = new Stack(app);
const eventBus = new EventBus(stack, 'eventbus', {
      eventBusName: 'EventBus',
    });
const archive = new Archive(eventBus, 'archive', {
      sourceEventBus: eventBus,
      eventPattern: {
        source: ['test'],
      },
    });
const cfnArchive = archive.node.defaultChild as CfnArchive; // This fails

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.20.0

Framework Version

No response

Node.js Version

14.19.1

OS

Ubuntu 18

Language

Typescript

Language Version

4.4.4

Other information

No response

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 effortgood first issueRelated to contributions. See CONTRIBUTING.mdp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions