Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow elastic throughput mode for efs #2026

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/20231228-efs-elastic-mode.yml
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 2 additions & 2 deletions plugins/modules/efs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
throughput_mode:
description:
- The throughput_mode for the file system to be created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a sentence like "Support for C(elastic) was added in version 7.1.0."

lotyp marked this conversation as resolved.
Show resolved Hide resolved
choices: ['bursting', 'provisioned']
choices: ['bursting', 'provisioned', 'elastic']
type: str
provisioned_throughput_in_mibps:
description:
Expand Down Expand Up @@ -733,7 +733,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),
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/targets/efs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the error message from the integration tests, we can't make any more changes to the current volume. (Notice that the "wait until" date is the day after the test was run):

2024-01-11 20:10:09.701316 | controller |     "message": "You have reached the maximum number of throughput mode changes or provisioned throughput value decreases. Wait until 2024-01-12T20:09:02Z UTC and try again.",
2024-01-11 20:10:09.701322 | controller |     "msg": "Unable to update file system.: An error occurred (TooManyRequests) when calling the UpdateFileSystem operation (reached max retries: 4): You have reached the maximum number of throughput mode changes or provisioned throughput value decreases. Wait until 2024-01-12T20:09:02Z UTC and try again.",

This test will need to be run using a different EFS volume (I'd suggest creating a fresh volume rather than updating this existing one).

Suggested change
name: "{{ efs_name }}-test-efs"
name: "{{ efs_name }}-test-efs-2"

(please update the always block to also delete "{{ efs_name }}-test-efs-2")

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:
Expand Down