Skip to content

Commit

Permalink
feat(client-rds): Adding support for RDS Aurora Global Database Unpla…
Browse files Browse the repository at this point in the history
…nned Failover
  • Loading branch information
awstools committed Aug 21, 2023
1 parent be667e9 commit d92f127
Show file tree
Hide file tree
Showing 16 changed files with 28,197 additions and 27,780 deletions.
8 changes: 8 additions & 0 deletions clients/client-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,14 @@ SwitchoverBlueGreenDeployment

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/classes/switchoverbluegreendeploymentcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/switchoverbluegreendeploymentcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/switchoverbluegreendeploymentcommandoutput.html)

</details>
<details>
<summary>
SwitchoverGlobalCluster
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/classes/switchoverglobalclustercommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/switchoverglobalclustercommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/switchoverglobalclustercommandoutput.html)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-rds/src/RDS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,11 @@ import {
SwitchoverBlueGreenDeploymentCommandInput,
SwitchoverBlueGreenDeploymentCommandOutput,
} from "./commands/SwitchoverBlueGreenDeploymentCommand";
import {
SwitchoverGlobalClusterCommand,
SwitchoverGlobalClusterCommandInput,
SwitchoverGlobalClusterCommandOutput,
} from "./commands/SwitchoverGlobalClusterCommand";
import {
SwitchoverReadReplicaCommand,
SwitchoverReadReplicaCommandInput,
Expand Down Expand Up @@ -862,6 +867,7 @@ const commands = {
StopDBInstanceCommand,
StopDBInstanceAutomatedBackupsReplicationCommand,
SwitchoverBlueGreenDeploymentCommand,
SwitchoverGlobalClusterCommand,
SwitchoverReadReplicaCommand,
};

Expand Down Expand Up @@ -3223,6 +3229,23 @@ export interface RDS {
cb: (err: any, data?: SwitchoverBlueGreenDeploymentCommandOutput) => void
): void;

/**
* @see {@link SwitchoverGlobalClusterCommand}
*/
switchoverGlobalCluster(
args: SwitchoverGlobalClusterCommandInput,
options?: __HttpHandlerOptions
): Promise<SwitchoverGlobalClusterCommandOutput>;
switchoverGlobalCluster(
args: SwitchoverGlobalClusterCommandInput,
cb: (err: any, data?: SwitchoverGlobalClusterCommandOutput) => void
): void;
switchoverGlobalCluster(
args: SwitchoverGlobalClusterCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: SwitchoverGlobalClusterCommandOutput) => void
): void;

/**
* @see {@link SwitchoverReadReplicaCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-rds/src/RDSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ import {
SwitchoverBlueGreenDeploymentCommandInput,
SwitchoverBlueGreenDeploymentCommandOutput,
} from "./commands/SwitchoverBlueGreenDeploymentCommand";
import {
SwitchoverGlobalClusterCommandInput,
SwitchoverGlobalClusterCommandOutput,
} from "./commands/SwitchoverGlobalClusterCommand";
import {
SwitchoverReadReplicaCommandInput,
SwitchoverReadReplicaCommandOutput,
Expand Down Expand Up @@ -671,6 +675,7 @@ export type ServiceInputTypes =
| StopDBInstanceAutomatedBackupsReplicationCommandInput
| StopDBInstanceCommandInput
| SwitchoverBlueGreenDeploymentCommandInput
| SwitchoverGlobalClusterCommandInput
| SwitchoverReadReplicaCommandInput;

/**
Expand Down Expand Up @@ -819,6 +824,7 @@ export type ServiceOutputTypes =
| StopDBInstanceAutomatedBackupsReplicationCommandOutput
| StopDBInstanceCommandOutput
| SwitchoverBlueGreenDeploymentCommandOutput
| SwitchoverGlobalClusterCommandOutput
| SwitchoverReadReplicaCommandOutput;

/**
Expand Down
2 changes: 2 additions & 0 deletions clients/client-rds/src/commands/CreateGlobalClusterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ export interface CreateGlobalClusterCommandOutput extends CreateGlobalClusterRes
* // ],
* // IsWriter: true || false,
* // GlobalWriteForwardingStatus: "enabled" || "disabled" || "enabling" || "disabling" || "unknown",
* // SynchronizationStatus: "connected" || "pending-resync",
* // },
* // ],
* // FailoverState: { // FailoverState
* // Status: "pending" || "failing-over" || "cancelling",
* // FromDbClusterArn: "STRING_VALUE",
* // ToDbClusterArn: "STRING_VALUE",
* // IsDataLossAllowed: true || false,
* // },
* // },
* // };
Expand Down
2 changes: 2 additions & 0 deletions clients/client-rds/src/commands/DeleteGlobalClusterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ export interface DeleteGlobalClusterCommandOutput extends DeleteGlobalClusterRes
* // ],
* // IsWriter: true || false,
* // GlobalWriteForwardingStatus: "enabled" || "disabled" || "enabling" || "disabling" || "unknown",
* // SynchronizationStatus: "connected" || "pending-resync",
* // },
* // ],
* // FailoverState: { // FailoverState
* // Status: "pending" || "failing-over" || "cancelling",
* // FromDbClusterArn: "STRING_VALUE",
* // ToDbClusterArn: "STRING_VALUE",
* // IsDataLossAllowed: true || false,
* // },
* // },
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { DBEngineVersionMessage, DescribeDBEngineVersionsMessage } from "../models/models_0";
import { DBEngineVersionMessage } from "../models/models_0";
import { DescribeDBEngineVersionsMessage } from "../models/models_1";
import { de_DescribeDBEngineVersionsCommand, se_DescribeDBEngineVersionsCommand } from "../protocols/Aws_query";
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ export interface DescribeGlobalClustersCommandOutput extends GlobalClustersMessa
* // ],
* // IsWriter: true || false,
* // GlobalWriteForwardingStatus: "enabled" || "disabled" || "enabling" || "disabling" || "unknown",
* // SynchronizationStatus: "connected" || "pending-resync",
* // },
* // ],
* // FailoverState: { // FailoverState
* // Status: "pending" || "failing-over" || "cancelling",
* // FromDbClusterArn: "STRING_VALUE",
* // ToDbClusterArn: "STRING_VALUE",
* // IsDataLossAllowed: true || false,
* // },
* // },
* // ],
Expand Down
49 changes: 38 additions & 11 deletions clients/client-rds/src/commands/FailoverGlobalClusterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,42 @@ export interface FailoverGlobalClusterCommandOutput extends FailoverGlobalCluste

/**
* @public
* <p>Initiates the failover process for an Aurora global database (<a>GlobalCluster</a>).</p>
* <p>A failover for an Aurora global database promotes one of secondary read-only DB clusters to be
* the primary DB cluster and demotes the primary DB cluster to being a secondary (read-only) DB cluster. In other words,
* the role of the current primary DB cluster and the selected (target) DB cluster are switched. The selected
* secondary DB cluster assumes full read/write capabilities for the Aurora global database.</p>
* <p>For more information about failing over an Amazon Aurora global database, see
* <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-disaster-recovery.managed-failover">Managed planned failover for Amazon Aurora global
* databases</a> in the <i>Amazon Aurora User Guide</i>.</p>
* <p>Promotes the specified secondary DB cluster to be the primary DB cluster in the global database cluster to fail over or switch over a global database. Switchover operations were previously called "managed planned failovers."</p>
* <note>
* <p>This action applies to <a>GlobalCluster</a> (Aurora global databases) only. Use this action only on
* healthy Aurora global databases with running Aurora DB clusters and no Region-wide outages, to test disaster recovery scenarios or to
* reconfigure your Aurora global database topology.</p>
* <p>Although this operation can be used either to fail over or to switch over a global database cluster, its intended use is for global database failover.
* To switch over a global database cluster, we recommend that you use the <a>SwitchoverGlobalCluster</a> operation instead.</p>
* </note>
* <p>How you use this operation depends on whether you are failing over or switching over your global database cluster:</p>
* <ul>
* <li>
* <p>Failing over - Specify the <code>AllowDataLoss</code> parameter and don't specify the <code>Switchover</code> parameter.</p>
* </li>
* <li>
* <p>Switching over - Specify the <code>Switchover</code> parameter or omit it, but don't specify the <code>AllowDataLoss</code> parameter.</p>
* </li>
* </ul>
* <p>
* <b>About failing over and switching over</b>
* </p>
* <p>While failing over and switching over a global database cluster both change the primary DB cluster, you use these operations for different reasons:</p>
* <ul>
* <li>
* <p>
* <i>Failing over</i> - Use this operation to respond to an unplanned event, such as a Regional disaster in the primary Region.
* Failing over can result in a loss of write transaction data that wasn't replicated to the chosen secondary before the failover event occurred.
* However, the recovery process that promotes a DB instance on the chosen seconday DB cluster to be the primary writer DB instance guarantees
* that the data is in a transactionally consistent state.</p>
* <p>For more information about failing over an Amazon Aurora global database, see
* <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-failover.managed-unplanned">Performing managed failovers for Aurora global databases</a> in the <i>Amazon Aurora User Guide</i>.</p>
* </li>
* <li>
* <p>
* <i>Switching over</i> - Use this operation on a healthy global database cluster for planned events, such as Regional rotation or to
* fail back to the original primary DB cluster after a failover operation. With this operation, there is no data loss.</p>
* <p>For more information about switching over an Amazon Aurora global database, see
* <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-disaster-recovery.managed-failover">Performing switchovers for Aurora global databases</a> in the <i>Amazon Aurora User Guide</i>.</p>
* </li>
* </ul>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -58,6 +81,8 @@ export interface FailoverGlobalClusterCommandOutput extends FailoverGlobalCluste
* const input = { // FailoverGlobalClusterMessage
* GlobalClusterIdentifier: "STRING_VALUE", // required
* TargetDbClusterIdentifier: "STRING_VALUE", // required
* AllowDataLoss: true || false,
* Switchover: true || false,
* };
* const command = new FailoverGlobalClusterCommand(input);
* const response = await client.send(command);
Expand All @@ -80,12 +105,14 @@ export interface FailoverGlobalClusterCommandOutput extends FailoverGlobalCluste
* // ],
* // IsWriter: true || false,
* // GlobalWriteForwardingStatus: "enabled" || "disabled" || "enabling" || "disabling" || "unknown",
* // SynchronizationStatus: "connected" || "pending-resync",
* // },
* // ],
* // FailoverState: { // FailoverState
* // Status: "pending" || "failing-over" || "cancelling",
* // FromDbClusterArn: "STRING_VALUE",
* // ToDbClusterArn: "STRING_VALUE",
* // IsDataLossAllowed: true || false,
* // },
* // },
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface ModifyGlobalClusterCommandOutput extends ModifyGlobalClusterRes

/**
* @public
* <p>Modifies a setting for an Amazon Aurora global cluster. You can change one or more database configuration
* <p>Modifies a setting for an Amazon Aurora global database cluster. You can change one or more database configuration
* parameters by specifying these parameters and the new values in the request. For more information on
* Amazon Aurora, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html"> What is Amazon Aurora?</a> in the
* <i>Amazon Aurora User Guide</i>.</p>
Expand Down Expand Up @@ -77,12 +77,14 @@ export interface ModifyGlobalClusterCommandOutput extends ModifyGlobalClusterRes
* // ],
* // IsWriter: true || false,
* // GlobalWriteForwardingStatus: "enabled" || "disabled" || "enabling" || "disabling" || "unknown",
* // SynchronizationStatus: "connected" || "pending-resync",
* // },
* // ],
* // FailoverState: { // FailoverState
* // Status: "pending" || "failing-over" || "cancelling",
* // FromDbClusterArn: "STRING_VALUE",
* // ToDbClusterArn: "STRING_VALUE",
* // IsDataLossAllowed: true || false,
* // },
* // },
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ export interface RemoveFromGlobalClusterCommandOutput extends RemoveFromGlobalCl
* // ],
* // IsWriter: true || false,
* // GlobalWriteForwardingStatus: "enabled" || "disabled" || "enabling" || "disabling" || "unknown",
* // SynchronizationStatus: "connected" || "pending-resync",
* // },
* // ],
* // FailoverState: { // FailoverState
* // Status: "pending" || "failing-over" || "cancelling",
* // FromDbClusterArn: "STRING_VALUE",
* // ToDbClusterArn: "STRING_VALUE",
* // IsDataLossAllowed: true || false,
* // },
* // },
* // };
Expand Down
Loading

0 comments on commit d92f127

Please sign in to comment.