Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GomathiselviS committed Oct 17, 2023
1 parent 077fb7f commit f9b6d89
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
3 changes: 0 additions & 3 deletions changelogs/fragments/rds_global_cluster_info.yml

This file was deleted.

4 changes: 2 additions & 2 deletions plugins/modules/rds_global_cluster_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
type: list
contains:
global_cluster_identifier:
description: User-supplied global database cluster identifier..
description: User-supplied global database cluster identifier.
type: str
sample: "ansible-test-global-cluster"
global_cluster_resource_id:
Expand Down Expand Up @@ -125,7 +125,7 @@
contains:
status:
description:
- The current status of the global cluster. Possible values are as follows
- The current status of the global cluster.
type: str
sample: "pending"
from_db_cluster_arn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,34 @@
- global_cluster_info.global_clusters[0].global_cluster_members[1].db_cluster_arn == secondary_cluster_info_result.clusters[0].db_cluster_arn
- global_cluster_info.global_clusters[0].engine == engine

- name: Get Global DB information
amazon.aws.rds_global_cluster_info:
filters:
engine: "{{ engine }}"
region: "{{ aws_region }}"
register: global_cluster_filter_info

- name: Assert that the filter result is as expected
ansible.builtin.assert:
that:
- global_cluster_info.global_clusters[0] == item
when: item.global_cluster_identifier == global_cluster_id
loop: "{{ global_cluster_filter_info.global_clusters }}"

always:
- name: Delete secondary cluster without creating a final snapshot
amazon.aws.rds_cluster:
cluster_id: "{{ secondary_cluster_id }}"
region: "eu-north-1"
global_cluster_identifier: "{{ obal_cluster_id }}"
global_cluster_identifier: "{{ global_cluster_id }}"
remove_from_global_db: true
skip_final_snapshot: True
state: absent
ignore_errors: true

- name: Delete instance attached to primary uster
amazon.aws.rds_instance:
db_instance_identifier: "{{ imary_instance_id }}"
db_instance_identifier: "{{ primary_instance_id }}"
region: "{{ aws_region }}"
skip_final_snapshot: true
wait: false
Expand All @@ -94,16 +108,15 @@
- name: Delete primary cluster without creating a nal snapshot
amazon.aws.rds_cluster:
cluster_id: "{{ primary_cluster_id }}"
lobal_cluster_identifier: "{{ obal_cluster_id }}"
global_cluster_identifier: "{{ global_cluster_id }}"
skip_final_snapshot: True
region: "{{ aws_region }}"
state: absent
ignore_errors: true

- name: Delete DB cluster without creating a final snapshot
amazon.aws.rds_cluster:
- name: Delete Global DB cluster
amazon.cloud.rds_global_cluster:
state: absent
cluster_id: "{{ global_cluster_id }}"
skip_final_snapshot: true
global_cluster_identifier: "{{ global_cluster_id }}"
region: "{{ aws_region }}"
ignore_errors: true

0 comments on commit f9b6d89

Please sign in to comment.