Repository: ansible-collections/amazon.aws

Issue:
ec2_vol passes null iops to boto when changing type w/ existing iops value
### Summary

When attempting to modify an existing io1 volume to io2 and supplying the existing iops value, the iops in req_obj is never set and boto rejects it due to the missing required parameter.

https://github.com/ansible-collections/amazon.aws/blob/7bdad1038f4fc88ce2612d786bf345b254b5ba54/plugins/modules/ec2_vol.py#L382-L386

The following fixes it:

```python
        if target_iops:
            original_iops = volume['iops']
            if target_iops != original_iops:
                iops_changed = True
                req_obj['Iops'] = target_iops
            else:
                req_obj['Iops'] = original_iops
```

I'd like to open a PR with this change to both main and stable-1.5.

### Issue Type

Bug Report

### Component Name

ec2_vol

### Ansible Version

```console (paste below)
ansible [core 2.11.6] 
```


### Collection Versions

```console (paste below)
Collection            Version
--------------------- -------
amazon.aws            1.5.1  
ansible.windows       1.8.0  
community.aws         1.5.0  
community.docker      1.10.2 
community.hashi_vault 2.1.0  
community.windows     1.8.0  
```


### AWS SDK versions

```console (paste below)
Name: boto
Version: 2.49.0
Summary: Amazon Web Services Library
Home-page: https://github.com/boto/boto/
Author: Mitch Garnaat
Author-email: mitch@garnaat.com
License: MIT
Location: /Users/john.mccall/.pyenv/versions/3.6.5/lib/python3.6/site-packages
Requires: 
Required-by: 
Name: boto3
Version: 1.18.31
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /Users/john.mccall/.pyenv/versions/3.6.5/lib/python3.6/site-packages
Requires: botocore, jmespath, s3transfer
Required-by: 
Name: botocore
Version: 1.21.31
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /Users/john.mccall/.pyenv/versions/3.6.5/lib/python3.6/site-packages
Requires: urllib3, jmespath, python-dateutil
Required-by: s3transfer, boto3
```


### Configuration

_No response_

### OS / Environment

MacOSX

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
amazon.aws.ec2_vol:
        region: "region-name"
        name: "disk-name"
        device_name: "device-name"
        volume_type: io2
        volume_size: 50
        iops: 16000
        modify_volume: true
```


### Expected Results

I expect the existing io1 volume to change to io2, but it errors out with the below.


### Actual Results

> The error was: botocore.exceptions.ClientError: An error occurred (InvalidParameterCombination) when calling the ModifyVolume operation: The parameter iops must be specified for io2 volumes.

### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:

Resolving patch:
diff --git a/plugins/modules/ec2_vol.py b/plugins/modules/ec2_vol.py
--- a/plugins/modules/ec2_vol.py
+++ b/plugins/modules/ec2_vol.py
@@ -384,6 +384,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,


Test patch: