There seems to be an issue with the Schedule import used in scaleOnSchedule. Depending on which AWS CDK library the Schedule class is imported from, the code exhibits different behavior:
import { Schedule } from "aws-cdk-lib/aws-applicationautoscaling": Works
import { Schedule } from "aws-cdk-lib/aws-events": Works
import { Schedule } from "aws-cdk-lib/aws-autoscaling": Fails
Expected Behavior
The Schedule import should be unambiguous, and the code should function consistently regardless of which AWS CDK library it is imported from.
Current Behavior
You may import the wrong Schedule without noticing until deployment.
Describe the bug
Ambiguous
Schedule
import causing inconsistent behaviorThere seems to be an issue with the
Schedule
import used inscaleOnSchedule
. Depending on which AWS CDK library theSchedule
class is imported from, the code exhibits different behavior:import { Schedule } from "aws-cdk-lib/aws-applicationautoscaling"
: Worksimport { Schedule } from "aws-cdk-lib/aws-events"
: Worksimport { Schedule } from "aws-cdk-lib/aws-autoscaling"
: FailsExpected Behavior
The
Schedule
import should be unambiguous, and the code should function consistently regardless of which AWS CDK library it is imported from.Current Behavior
You may import the wrong
Schedule
without noticing until deployment.Reproduction Steps
Use the following code snippet:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.145.0
Framework Version
No response
Node.js Version
20.13.1
OS
Ubuntu 22.04.3 LTS
Language
TypeScript
Language Version
No response
Other information
No response