diff --git a/changelogs/fragments/606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml b/changelogs/fragments/606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml new file mode 100644 index 00000000000..c3c1580d463 --- /dev/null +++ b/changelogs/fragments/606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml @@ -0,0 +1,5 @@ +bugfixes: +- >- + ec2_vol - Sets the Iops value in req_obj even if the iops value + has not changed, to allow modifying volume types that require + passing an iops value to boto. (https://github.com/ansible-collections/amazon.aws/pull/606) diff --git a/plugins/modules/ec2_vol.py b/plugins/modules/ec2_vol.py index a7b7990c916..ffbc94f176f 100644 --- a/plugins/modules/ec2_vol.py +++ b/plugins/modules/ec2_vol.py @@ -373,6 +373,8 @@ def update_volume(module, ec2_conn, volume): if target_iops != original_iops: iops_changed = True req_obj['Iops'] = target_iops + else: + req_obj['Iops'] = original_iops else: # If no IOPS value is specified and there was a volume_type update to gp3, # the existing value is retained, unless a volume type is modified that supports different values, diff --git a/tests/integration/constraints.txt b/tests/integration/constraints.txt new file mode 100644 index 00000000000..e69de29bb2d