@Override public void removeClusterInfrastructure() { autoScaling.deletePolicy(new DeletePolicyRequest().withAutoScalingGroupName(getAutoScalingGroup().getAutoScalingGroupName()).withPolicyName(SCALE_UP_POLICY)); autoScaling.deletePolicy(new DeletePolicyRequest().withAutoScalingGroupName(getAutoScalingGroup().getAutoScalingGroupName()).withPolicyName(SCALE_DOWN_POLICY)); cloudWatch.deleteAlarms(new DeleteAlarmsRequest().withAlarmNames(ESS_OVERLOAD_ALARM, ESS_IDLE_ALARM)); // CloudWatch metrics are stored for two weeks. Old data will be removed automatically. amazonSQS.deleteQueue(new DeleteQueueRequest().withQueueUrl(ESS_QUEUE_NAME)); cloudFormation.deleteStack(new DeleteStackRequest().withStackName(SystemUtils.getCloudFormationStackName())); }
public void deletePolicy(String asGroupName, String policyName) { logger.info("delete scaling policy, asGroup={}, policy={}", asGroupName, policyName); autoScaling.deletePolicy(new DeletePolicyRequest() .withAutoScalingGroupName(asGroupName) .withPolicyName(policyName)); }