diff --git a/changelogs/fragments/20231228-efs-elastic-mode.yml b/changelogs/fragments/20231228-efs-elastic-mode.yml new file mode 100644 index 00000000000..ef8336e6f82 --- /dev/null +++ b/changelogs/fragments/20231228-efs-elastic-mode.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - efs module - added "elastic" throughput mode to allow dynamic adjustment of throughput (https://github.com/ansible-collections/community.aws/issues/1884). diff --git a/plugins/modules/efs.py b/plugins/modules/efs.py index df79babc92c..32eed712b33 100644 --- a/plugins/modules/efs.py +++ b/plugins/modules/efs.py @@ -72,7 +72,8 @@ throughput_mode: description: - The throughput_mode for the file system to be created. - choices: ['bursting', 'provisioned'] + - Support for I(throughput_mode=elastic) was added in release 7.2.0. + choices: ['bursting', 'provisioned', 'elastic'] type: str provisioned_throughput_in_mibps: description: @@ -733,7 +734,7 @@ def main(): required=False, type="str", choices=["general_purpose", "max_io"], default="general_purpose" ), transition_to_ia=dict(required=False, type="str", choices=["None", "7", "14", "30", "60", "90"], default=None), - throughput_mode=dict(required=False, type="str", choices=["bursting", "provisioned"], default=None), + throughput_mode=dict(required=False, type="str", choices=["bursting", "provisioned", "elastic"], default=None), provisioned_throughput_in_mibps=dict(required=False, type="float"), wait=dict(required=False, type="bool", default=False), wait_timeout=dict(required=False, type="int", default=0), diff --git a/tests/integration/targets/efs/tasks/main.yml b/tests/integration/targets/efs/tasks/main.yml index bc23f3a1199..b671300e3a8 100644 --- a/tests/integration/targets/efs/tasks/main.yml +++ b/tests/integration/targets/efs/tasks/main.yml @@ -303,6 +303,22 @@ that: - efs_result is not changed + # ============================================================ + - name: Update Efs to use elastic throughput_mode + community.aws.efs: + state: present + name: "{{ efs_name }}-test-efs" + tags: + Name: "{{ efs_name }}-test-tag" + Purpose: file-storage + throughput_mode: 'elastic' + register: efs_result + + - assert: + that: + - efs_result is changed + - efs_result.efs.throughput_mode == "elastic" + # ============================================================ - name: Query unknown EFS by tag efs_info: