(aws-lambda): Alias.scaleOnSchedule()
doesn't make clear which Schedule
to use
#30502
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p3
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
The text was updated successfully, but these errors were encountered: