PARALLAX

application_autoscaling_policy

Manage Application Auto Scaling Scaling Policies

Collection: community.aws

Full Name: community.aws.application_autoscaling_policy

Synopsis

Manage Application Auto Scaling Scaling Policies

Parameters

NameTypeRequiredDefaultDescription
access_keystr
aws_ca_bundlepath
aws_configdict
debug_botocore_endpoint_logsboolfalse
endpoint_urlstr
maximum_tasksint
minimum_tasksint
override_task_capacitybool
policy_namestryes
policy_typestryes
profilestr
regionstr
resource_idstryes
scalable_dimensionstryes
secret_keystr
service_namespacestryes
session_tokenstr
statestryes
step_scaling_policy_configurationdict
target_tracking_scaling_policy_configurationdict
validate_certsbooltrue

Example

yaml
# Create step scaling policy for ECS Service
- name: scaling_policy
  community.aws.application_autoscaling_policy:
    state: present
    policy_name: test_policy
    service_namespace: ecs
    resource_id: service/poc-pricing/test-as
    scalable_dimension: ecs:service:DesiredCount
    policy_type: StepScaling
    minimum_tasks: 1
    maximum_tasks: 6
    step_scaling_policy_configuration:
        AdjustmentType: ChangeInCapacity
        StepAdjustments:
            - MetricIntervalUpperBound: 123
              ScalingAdjustment: 2
            - MetricIntervalLowerBound: 123
              ScalingAdjustment: -2
        Cooldown: 123
        MetricAggregationType: Average

# Create target tracking scaling policy for ECS Service
- name: scaling_policy
  community.aws.application_autoscaling_policy:
    state: present
    policy_name: test_policy
    service_namespace: ecs
    resource_id: service/poc-pricing/test-as
    scalable_dimension: ecs:service:DesiredCount
    policy_type: TargetTrackingScaling
    minimum_tasks: 1
    maximum_tasks: 6
    target_tracking_scaling_policy_configuration:
        TargetValue: 60
        PredefinedMetricSpecification:
            PredefinedMetricType: ECSServiceAverageCPUUtilization
        ScaleOutCooldown: 60
        ScaleInCooldown: 60

# Remove scalable target for ECS Service
- name: scaling_policy
  community.aws.application_autoscaling_policy:
    state: absent
    policy_name: test_policy
    policy_type: StepScaling
    service_namespace: ecs
    resource_id: service/cluster-name/service-name
    scalable_dimension: ecs:service:DesiredCount
Search
    ↑ ↓ move↵ openesc close