Skip to content

autoscaling_policy incorrectly forces int for StepScaling bounds, but AWS allows float #2355

Closed

Description

@sethernet

Summary

The autoscaling_policy module currently enforces integer types for step_adjustments values (lower_bound, upper_bound, etc.). However, AWS put_scaling_policy (via boto3) and the AWS Console both support floats for MetricIntervalLowerBound and MetricIntervalUpperBound in Step Scaling policies.

This makes it impossible to define valid scaling windows such as:

step_adjustments:
  - MetricIntervalLowerBound: 0.10
    MetricIntervalUpperBound: 0.85
    ScalingAdjustment: 25

Issue Type

Bug Report

Component Name

autoscaling_policy

Steps to Reproduce

Try to create a policy like:

autoscaling_policy:
    state: present
    region: us-east-1
    name: my-scale-up-policy
    asg_name: my-asg
    adjustment_type: PercentChangeInCapacity
    policy_type: StepScaling
    cooldown: 300
    step_adjustments:
      - lower_bound: 0.10
        upper_bound: 0.85
        scaling_adjustment: 25

Expected Results

autoscaling_policy should accept floats for StepScaling bounds to match AWS API and console capabilities.

Actual Results

When using this module with floats for the bounds, Ansible fails with type-conversion error:

Invalid type for parameter MetricIntervalLowerBound, value: 0.1, type: <class 'float'>, valid types: <class 'int'>

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Activity

  1. changed the title [-]ec2_scaling_policy incorrectly forces int for StepScaling bounds, but AWS allows float[/-] [+]autoscaling_policy incorrectly forces int for StepScaling bounds, but AWS allows float[/+] on Dec 3, 2025
  2. alinabuzachis commented on Dec 16, 2025

    @alinabuzachis
    Contributor

    @sethernet Thank you for raising this. Would you be willing to work on the implementation and open a Pull Request?

  3. added
    waiting_on_contributor
    on Dec 16, 2025
  4. added 2 commits that reference this issue on Jun 12, 2026
    e7ce72e
    003009a
  5. added a commit that references this issue on Jun 12, 2026
    0797ce3
  6. added a commit that references this issue on Aug 18, 2026
    9f9c0f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting_on_contributor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions