From 7844a8f7347f332b06417617f9d4e769c97913c8 Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Tue, 26 Sep 2023 16:07:07 -0700 Subject: [PATCH] minor fix --- plugins/modules/rds_cluster.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/modules/rds_cluster.py b/plugins/modules/rds_cluster.py index a8d8bcd4007..7378bd86d48 100644 --- a/plugins/modules/rds_cluster.py +++ b/plugins/modules/rds_cluster.py @@ -1333,17 +1333,17 @@ def main(): else: changed |= ensure_present(cluster, parameters, method_name, method_options_name) - if cluster and module.params.get("remove_from_global_db"): - if cluster["Engine"] in ["aurora", "aurora-mysql", "aurora-postgresql"]: - if changed: - wait_for_cluster_status(client, module, cluster_id, "cluster_available") - changed |= handle_remove_from_global_db(module, cluster) - if not module.check_mode and module.params["new_db_cluster_identifier"] and module.params["apply_immediately"]: cluster_id = module.params["new_db_cluster_identifier"] else: cluster_id = module.params["db_cluster_identifier"] + if cluster_id and get_cluster(cluster_id) and module.params.get("remove_from_global_db"): + if cluster["Engine"] in ["aurora", "aurora-mysql", "aurora-postgresql"]: + if changed: + wait_for_cluster_status(client, module, cluster_id, "cluster_available") + changed |= handle_remove_from_global_db(module, cluster) + result = camel_dict_to_snake_dict(get_cluster(cluster_id)) if result: