Skip to content

Commit

Permalink
Refactor ec2_nat_gateway*, ec2_vpc_igw*, ec2_snapshot*, ec2_spot_inst…
Browse files Browse the repository at this point in the history
…ance* (ansible-collections#2099)

SUMMARY

This pull request contains a set of changes:
module_utils/ec2.py: add a set of AWS API wrapped into retry and AnsibleEC2ErrorHandler, some of them will be used later to refactor others ec2_* modules
Refactorec2_vol*, ec2_nat_gateway*, ec2_vpc_igw*, ec2_snapshot*, ec2_spot_instance* modules: add type hint, the main() function should be limited to call either ensure_[absent|present] functions or any others function to describe resources.

The changes in this PR have been extracted from ansible-collections#2076

ISSUE TYPE


Feature Pull Request

COMPONENT NAME


ec2_snapshot
ec2_snapshot_info
ec2_spot_instance
ec2_spot_instance_info
ec2_vol
ec2_vol_info
ec2_vpc_igw
ec2_vpc_igw_info
ec2_vpc_nat_gateway
ec2_vpc_nat_gateway_info

ADDITIONAL INFORMATION

Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Bikouo Aubin
Reviewed-by: GomathiselviS
  • Loading branch information
abikouo authored Jun 18, 2024
1 parent a7b9cac commit 2643289
Show file tree
Hide file tree
Showing 17 changed files with 1,537 additions and 685 deletions.
10 changes: 10 additions & 0 deletions changelogs/fragments/20240516-ec2-refactor-some-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
minor_changes:
- ec2_snapshot - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
- ec2_snapshot_info - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
- ec2_spot_instance - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
- ec2_spot_instance_info - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
- ec2_vpc_igw - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
- ec2_vpc_igw_info - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
- ec2_vpc_nat_gateway - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
- ec2_vpc_nat_gateway_info - refactored code to use ``AnsibleEC2Error`` as well as moving shared code into module_utils.ec2 (https://github.com/ansible-collections/amazon.aws/pull/2099).
Loading

0 comments on commit 2643289

Please sign in to comment.