I'm facing the error below using the third-party registry extension AwsCommunity::ApplicationAutoscaling::ScheduledAction when MaxCapacity and MinCapacity are both set to zero 0 in the ScalableTargetAction property.
Create error - ValidationException('An error occurred (ValidationException) when calling the PutScheduledAction operation: At least one of minimum capacity and maximum capacity should be provided')" (RequestToken: a1098eef-cadf-8842-8c06-2812bbee4bc9, HandlerErrorCode: InternalFailure)
The API responsible for throwing the error above is PutScheduledAction:
{
"eventVersion": "1.08",
"userIdentity": {
...
},
"eventTime": "2023-11-21T10:19:30Z",
"eventSource": "autoscaling.amazonaws.com",
"eventName": "PutScheduledAction",
"awsRegion": "eu-west-1",
"errorCode": "ValidationException",
"errorMessage": "At least one of minimum capacity and maximum capacity should be provided",
"requestParameters": {
"resourceId": "service/ECSSample/nginx",
"scalableTargetAction": {},
"scheduledActionName": "Scale.Down.Zero",
"scalableDimension": "ecs:service:DesiredCount",
"serviceNamespace": "ecs",
"timezone": "Europe/London",
"schedule": "cron(10 8 ? * MON-FRI)"
},
"responseElements": null,
"additionalEventData": {
"service": "application-autoscaling"
},
}
I noticed that the scalableTargetAction property in the requestParameters is empty when the call is made from CFN but when the same call with same configuration properties is called by AWS CLI the scalableTargetAction is correctly populated with the maxCapacity and minCapacity which results in a successful creation:
In summary, the issue lies when MinCapacity and MaxCapacity are both set to zero under ScalableTargetAction property using CloudFormation and when it passes it to the PutScheduledAction API, the scalableTargetAction property is empty which results in the error even though they (maxCapacity, minCapacity) were supplied in the template. I'm not sure if this is an issue with the third-party registry or with CloudFormation. The schema for AwsCommunity::ApplicationAutoscaling::ScheduledAction is outlined here.
Thanks team let me know if need further info.
Expected behavior
ScalableTargetAction is populated with the maxCapacity and minCapacity.
Extension Name
AwsCommunity::ApplicationAutoscaling::ScheduledAction
Describe the bug
Issue Description
Hi team,
I'm facing the error below using the third-party registry extension
AwsCommunity::ApplicationAutoscaling::ScheduledAction
whenMaxCapacity
andMinCapacity
are both set to zero0
in theScalableTargetAction
property.Input:
Template:
The API responsible for throwing the error above is
PutScheduledAction
:I noticed that the
scalableTargetAction
property in therequestParameters
is empty when the call is made from CFN but when the same call with same configuration properties is called by AWS CLI thescalableTargetAction
is correctly populated with themaxCapacity
andminCapacity
which results in a successful creation:aws application-autoscaling put-scheduled-action --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/ECSSample/nginx --scheduled-action-name scale-down-zero --schedule "cron(25 9 ? * MON-FRI)" --scalable-target-action MinCapacity=0,MaxCapacity=0
In summary, the issue lies when
MinCapacity
andMaxCapacity
are both set to zero underScalableTargetAction
property using CloudFormation and when it passes it to thePutScheduledAction
API, thescalableTargetAction
property is empty which results in the error even though they (maxCapacity, minCapacity) were supplied in the template. I'm not sure if this is an issue with the third-party registry or with CloudFormation. The schema forAwsCommunity::ApplicationAutoscaling::ScheduledAction
is outlined here.Thanks team let me know if need further info.
Expected behavior
ScalableTargetAction
is populated with themaxCapacity
andminCapacity
.Reproduction template