We have an Autoscaling policy set on an ASG and we need to enable or disable already existing scaling policy, how hard it would be,
you just pass Autoscaling Group Name , policy name and Enabled (OR disabled) and the the job done.
but what we are seeing here is a lot of things you need to provide based on policy type, if you dont provide policy type it considers Simple scaling as default policy.
If you choose TargetScaling as policy type then you need to pass policy configuration as well, so we have to get all the policy details before making this put call to enable/disable.
Now from that get call, you have to remove unrequired nodes likes policy ARNs and Alarms before sending it. You may get diffrent requirement for other policy types like StepScaling/SimpleScaling needs Adjustment types to be sent.
When you make get on TargetTracking policy you get empty array of scaling adjustments, which put call doesnt accept so you have to remove that as well.
Now the question I have here
- Is there any other way we can disable/enable policies easily ?
- Any workarounds you can suggest ?