diff --git a/plugins/modules/ec2_vol_info.py b/plugins/modules/ec2_vol_info.py index 2e484ab9285..95628075499 100644 --- a/plugins/modules/ec2_vol_info.py +++ b/plugins/modules/ec2_vol_info.py @@ -109,6 +109,10 @@ description: The Availability Zone of the volume. type: str sample: "us-east-1b" + throughput: + description: The throughput that the volume supports, in MiB/s. + type: int + sample: 131 ''' try: @@ -149,6 +153,7 @@ def get_volume_info(volume, region): 'type': volume["volume_type"], 'zone': volume["availability_zone"], 'region': region, + 'throughput': volume["throughput"], 'attachment_set': attachment_data, 'tags': boto3_tag_list_to_ansible_dict(volume['tags']) if "tags" in volume else None } diff --git a/tests/integration/targets/ec2_vol/tasks/tests.yml b/tests/integration/targets/ec2_vol/tasks/tests.yml index b170b5790df..45537e01d88 100644 --- a/tests/integration/targets/ec2_vol/tasks/tests.yml +++ b/tests/integration/targets/ec2_vol/tasks/tests.yml @@ -408,7 +408,7 @@ - name: volume type must be gp3 assert: that: - - v.type == 'gp3' + - v.type == 'gp3' vars: v: "{{ verify_gp3_change.volumes[0] }}" @@ -514,6 +514,23 @@ - gp3_volume.changed - gp3_volume.volume.throughput == 130 + - name: Read volume information to validate throughput + ec2_vol_info: + filters: + volume-id: "{{ gp3_volume.volume_id }}" + register: verify_throughput + + - name: throughput must be equal to 130 + assert: + that: + - v.throughput == 130 + vars: + v: "{{ verify_throughput.volumes[0] }}" + + - name: print out facts + debug: + var: vol_facts + - name: increase throughput ec2_vol: volume_size: 1