def _validate_autoscaling_params(params):
 if (not params['autoscaling']):
  return (True, '')
 if (not isinstance(params['autoscaling'], dict)):
  return (False, 'autoscaling: configuration expected to be a dictionary.')
 as_req_fields = [{'name': 'name', 'required': True, 'type': str}, {'name': 'enabled', 'required': True, 'type': bool}, {'name': 'policy', 'required': True, 'type': dict}]
 (as_req_valid, as_req_msg) = _check_params(params['autoscaling'], as_req_fields)
 if (not as_req_valid):
  return (False, as_req_msg)
 as_policy_fields = [{'name': 'max_instances', 'required': True, 'type': int}, {'name': 'min_instances', 'required': False, 'type': int}, {'name': 'cool_down_period', 'required': False, 'type': int}]
 (as_policy_valid, as_policy_msg) = _check_params(params['autoscaling']['policy'], as_policy_fields)
 if (not as_policy_valid):
  return (False, as_policy_msg)
 return (True, '')

def _validate_autoscaling_params ( params ) : if ( not params [ 'autoscaling' ] ) : return ( True , '' ) if ( not isinstance ( params [ 'autoscaling' ] , dict ) ) : return ( False , 'autoscaling: configuration expected to be a dictionary.' ) as_req_fields = [ { 'name' : 'name' , 'required' : True , 'type' : str } , { 'name' : 'enabled' , 'required' : True , 'type' : bool } , { 'name' : 'policy' , 'required' : True , 'type' : dict } ] ( as_req_valid , as_req_msg ) = _check_params ( params [ 'autoscaling' ] , as_req_fields ) if ( not as_req_valid ) : return ( False , as_req_msg ) as_policy_fields = [ { 'name' : 'max_instances' , 'required' : True , 'type' : int } , { 'name' : 'min_instances' , 'required' : False , 'type' : int } , { 'name' : 'cool_down_period' , 'required' : False , 'type' : int } ] ( as_policy_valid , as_policy_msg ) = _check_params ( params [ 'autoscaling' ] [ 'policy' ] , as_policy_fields ) if ( not as_policy_valid ) : return ( False , as_policy_msg ) return ( True , '' )
validate that the minimum configuration is present for autoscaling .