Skip to content

Commit

Permalink
througput
Browse files Browse the repository at this point in the history
  • Loading branch information
abikouo committed May 26, 2021
1 parent b4478ba commit 836fa99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions plugins/modules/ec2_vol_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
}
Expand Down
19 changes: 18 additions & 1 deletion tests/integration/targets/ec2_vol/tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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] }}"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 836fa99

Please sign in to comment.