Describe the bug
AsgCapacityProviderProps declares autoscalingGroup to be an IAutoScalingGroup but then coerces to an AutoScalingGroup.
Expected Behavior
Properly handles IAutoScalingGroup or does not allow IAutoScalingGroup to be passed in.
Current Behavior
TypeError: this.autoScalingGroup.protectNewInstancesFromScaleIn is not a function
at new AsgCapacityProvider (/tmp/cdk-repro/node_modules/aws-cdk-lib/aws-ecs/lib/cluster.js:1:19024)
at new CdkCodebuildReproStack (/tmp/cdk-repro/lib/cdk-repro-stack.ts:15:5)
at Object.<anonymous> (/tmp/cdk-repro/bin/cdk-repro.ts:7:1)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.m._compile (/tmp/cdk-repro/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.require.extensions.<computed> [as .ts] (/tmp/cdk-repro/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
Reproduction Steps
const autoScalingGroup = AutoScalingGroup.fromAutoScalingGroupName(this, 'ASG', 'my-asg');
new AsgCapacityProvider(this, 'AsgCapacityProvider', { autoScalingGroup });
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.126.0
Framework Version
No response
Node.js Version
v20.10.0
OS
OSX
Language
TypeScript
Language Version
No response
Other information
No response
Describe the bug
AsgCapacityProviderPropsdeclaresautoscalingGroupto be anIAutoScalingGroupbut then coerces to anAutoScalingGroup.Expected Behavior
Properly handles
IAutoScalingGroupor does not allowIAutoScalingGroupto be passed in.Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.126.0
Framework Version
No response
Node.js Version
v20.10.0
OS
OSX
Language
TypeScript
Language Version
No response
Other information
No response