From 773852eca671567c7287455346cc5cd6bfeaab4b Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Tue, 7 Jun 2022 19:46:15 +0200 Subject: [PATCH] Add support for copy_db_cluster_snapshot for rds_cluster_snapshot (#840) Add support for copy_db_cluster_snapshot for rds_cluster_snapshot SUMMARY Add support for copy_db_cluster_snapshot for rds_cluster_snapshot Necessary for ansible-collections/community.aws#788 Just to verify: Depends-On: ansible/ansible-zuul-jobs#1520 ISSUE TYPE Feature Pull Request COMPONENT NAME module_utils/rds.py ADDITIONAL INFORMATION Reviewed-by: Joseph Torcasso Reviewed-by: Jill R --- plugins/module_utils/rds.py | 2 +- tests/unit/module_utils/test_rds.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/rds.py b/plugins/module_utils/rds.py index 078477d126..a2a87227d2 100644 --- a/plugins/module_utils/rds.py +++ b/plugins/module_utils/rds.py @@ -38,7 +38,7 @@ cluster_snapshot_method_names = [ 'create_db_cluster_snapshot', 'delete_db_cluster_snapshot', 'add_tags_to_resource', 'remove_tags_from_resource', - 'list_tags_for_resource' + 'list_tags_for_resource', 'copy_db_cluster_snapshot' ] instance_snapshot_method_names = [ diff --git a/tests/unit/module_utils/test_rds.py b/tests/unit/module_utils/test_rds.py index c6ad8b3428..9e2d266449 100644 --- a/tests/unit/module_utils/test_rds.py +++ b/tests/unit/module_utils/test_rds.py @@ -476,6 +476,22 @@ def test__get_rds_method_attribute_instance(method_name, params, expected, error ) ), ), + ( + "copy_db_cluster_snapshot", + { + "source_db_cluster_snapshot_identifier": "test", + "db_cluster_snapshot_identifier": "test-copy" + }, + *expected( + rds.Boto3ClientMethod( + name="copy_db_cluster_snapshot", + waiter="db_cluster_snapshot_available", + operation_description="copy DB cluster snapshot", + resource='cluster_snapshot', + retry_codes=['InvalidDBClusterSnapshotState'] + ) + ), + ), ( "list_tags_for_resource", {