Skip to content

Commit ec8727f

Browse files
committed
[update] - add function to failover aurora cluster
1 parent eea9d96 commit ec8727f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

services/rds.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,25 @@ aws_rds_create_instance_snapshot_with_hint() {
156156

157157
# AWS events
158158
aws_rds_list_events() {
159-
aws rds describe-events
159+
aws_run_commandline 'aws rds describe-events'
160+
160161
}
161162

162163
# AWS rds reboot
163164

165+
aws_rds_failover_db_cluster() {
166+
aws_rds_db_cluster_name=$1
167+
aws_run_commandline \
168+
"
169+
aws rds failover-db-cluster \
170+
--db-cluster-identifier ${aws_rds_db_cluster_name:?'aws_rds_db_cluster_name is unset or empty'}
171+
"
172+
}
173+
174+
aws_rds_failover_db_cluster_with_hint() {
175+
aws_rds_db_cluster_name $(echo "$(peco_aws_list_db_clusters)" | peco)
176+
}
177+
164178
aws_rds_reboot_db_instance() {
165179
aws_rds_db_instance_identifier=$1
166180
echo Reboot the aws rds db instance ${aws_rds_db_instance_identifier:?"aws_rds_db_instance_identifier is unset or empty"}

0 commit comments

Comments
 (0)