aws / aws/aws-cdk

aws-events: EventsMetrics are not exported

Open
#22,166 4 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-events effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

We tried to utilise EventMetrics from aws-events/lib/events-canned-metrics-generated but this isn't actually exported.
This is the error we receive when we tried to import it: `Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './aws-events/lib/events-canned-metrics.generated' is not defined by "exports" in /node_modules/aws-cdk-lib/package.json`
I don't think this should be exported like that but the problem is that index.js in aws-events does not re-export it.

### Expected Behavior

Expect aws-events/lib/index.js to export * from 'events-canned-metrics.generated'.

### Current Behavior

aws-events/lib/index.js does not export * from 'events-canned-metrics.generated'.

### Reproduction Steps

Try to import EventMetrics

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.38.1 (build a5ced21)

### Framework Version

_No response_

### Node.js Version

v16.9.1

### OS

mac os

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with aws-events/lib/index.js and the events-canned-metrics.generated module named in the issue. Reproduce the EventMetrics import failure, then verify that the expected re-export makes the import work through the package's public path.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, developer-experience
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.