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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| debug_botocore_endpoint_logs | bool | false | ||
| endpoint_url | str | |||
| maximum_tasks | int | |||
| minimum_tasks | int | |||
| override_task_capacity | bool | |||
| policy_name | str | yes | ||
| policy_type | str | yes | ||
| profile | str | |||
| region | str | |||
| resource_id | str | yes | ||
| scalable_dimension | str | yes | ||
| secret_key | str | |||
| service_namespace | str | yes | ||
| session_token | str | |||
| state | str | yes | ||
| step_scaling_policy_configuration | dict | |||
| target_tracking_scaling_policy_configuration | dict | |||
| validate_certs | bool | true |
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