scalable_target#

Exec module for managing Amazon Application Autoscaling scalable target.

async idem_aws.exec.aws.application_autoscaling.scalable_target.get(hub, ctx, name, service_namespace: str, scaling_resource_ids: List[str] = None, scalable_dimension: str = None) Dict[source]#

Use an un-managed scaling target as a data-source. Supply one of the inputs as the filter.

Parameters:
  • name (str) – The name of the Idem state.

  • service_namespace (str) – The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use custom-resource instead.

  • scalable_dimension (str) – The scalable dimension. This string consists of the service namespace, resource type, and scaling property. ecs:service:DesiredCount

  • scaling_resource_ids (list[str], Optional) – The identifier of the resource associated with the scaling target. This string consists of the resource type and unique identifier.

Returns:

{"result": True|False, "comment": A message List, "ret": None|Dict}

Examples

Calling this exec module function from the cli with service_namespace

idem exec aws.application_autoscaling.scalable_target.get service_namespace="service_namespace"

Calling this exec module function from within a state module in pure python.

async def state_function(hub, ctx, name, service_namespace, scaling_resource_id, scalable_dimension):
    before = await hub.exec.aws.application_autoscaling.scalable_target.get(
    ctx=ctx,
    name=name,
    service_namespace=service_namespace,
    scaling_resource_ids=[scaling_resource_id],
    scalable_dimension=scalable_dimension,
)