Skip to content

modify_global_cluster async

modify_global_cluster(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
    new_global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
    deletion_protection: Optional[BooleanOptional] = None,
    engine_version: Optional[String] = None,
    allow_major_version_upgrade: Optional[BooleanOptional] = None,
) -> ModifyGlobalClusterResult

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 What is Amazon Aurora? in the Amazon Aurora User Guide.

This operation only applies to Aurora global database clusters.

Parameters:

  • global_cluster_identifier (Optional[GlobalClusterIdentifier], default: None ) –

    The cluster identifier for the global cluster to modify. This parameter isn't case-sensitive.

    Constraints:

    • Must match the identifier of an existing global database cluster.

  • new_global_cluster_identifier (Optional[GlobalClusterIdentifier], default: None ) –

    The new cluster identifier for the global database cluster. This value is stored as a lowercase string.

    Constraints:

    • Must contain from 1 to 63 letters, numbers, or hyphens.

    • The first character must be a letter.

    • Can't end with a hyphen or contain two consecutive hyphens.

    Example: my-cluster2

  • deletion_protection (Optional[BooleanOptional], default: None ) –

    Specifies whether to enable deletion protection for the global database cluster. The global database cluster can't be deleted when deletion protection is enabled.

  • engine_version (Optional[String], default: None ) –

    The version number of the database engine to which you want to upgrade.

    To list all of the available engine versions for aurora-mysql (for MySQL-based Aurora global databases), use the following command:

    aws rds describe-db-engine-versions --engine aurora-mysql --query '*[]|[?SupportsGlobalDatabases == `true`].[EngineVersion]'

    To list all of the available engine versions for aurora-postgresql (for PostgreSQL-based Aurora global databases), use the following command:

    aws rds describe-db-engine-versions --engine aurora-postgresql --query '*[]|[?SupportsGlobalDatabases == `true`].[EngineVersion]'

  • allow_major_version_upgrade (Optional[BooleanOptional], default: None ) –

    Specifies whether to allow major version upgrades.

    Constraints: Must be enabled if you specify a value for the EngineVersion parameter that's a different major version than the global cluster's current version.

    If you upgrade the major version of a global database, the cluster and DB instance parameter groups are set to the default parameter groups for the new version. Apply any custom parameter groups after completing the upgrade.

Raises:

Examples:

To modify a global database cluster The following example enables deletion protection for an Aurora MySQL-based global database cluster.

>>> await client.modify_global_cluster(global_cluster_identifier='myglobalcluster', deletion_protection=True)
Source code in docs_src/capo_rds/_services/async_rds.py
async def modify_global_cluster(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    global_cluster_identifier: Optional[
        "capo_rds.types.global_cluster_identifier.GlobalClusterIdentifier"
    ] = None,
    new_global_cluster_identifier: Optional[
        "capo_rds.types.global_cluster_identifier.GlobalClusterIdentifier"
    ] = None,
    deletion_protection: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
    engine_version: Optional["capo_rds.types.string.String"] = None,
    allow_major_version_upgrade: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_rds.types.modify_global_cluster_result.ModifyGlobalClusterResult":
    """<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> <note> <p>This operation only applies to Aurora global database clusters.</p> </note>

    Args:
        global_cluster_identifier: <p>The cluster identifier for the global cluster to modify. This parameter isn't case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing global database cluster.</p> </li> </ul>
        new_global_cluster_identifier: <p>The new cluster identifier for the global database cluster. This value is stored as a lowercase string.</p> <p>Constraints:</p> <ul> <li> <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p> </li> <li> <p>The first character must be a letter.</p> </li> <li> <p>Can't end with a hyphen or contain two consecutive hyphens.</p> </li> </ul> <p>Example: <code>my-cluster2</code> </p>
        deletion_protection: <p>Specifies whether to enable deletion protection for the global database cluster. The global database cluster can't be deleted when deletion protection is enabled.</p>
        engine_version: <p>The version number of the database engine to which you want to upgrade. </p> <p>To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL-based Aurora global databases), use the following command:</p> <p> <code>aws rds describe-db-engine-versions --engine aurora-mysql --query '*[]|[?SupportsGlobalDatabases == `true`].[EngineVersion]'</code> </p> <p>To list all of the available engine versions for <code>aurora-postgresql</code> (for PostgreSQL-based Aurora global databases), use the following command:</p> <p> <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query '*[]|[?SupportsGlobalDatabases == `true`].[EngineVersion]'</code> </p>
        allow_major_version_upgrade: <p>Specifies whether to allow major version upgrades.</p> <p>Constraints: Must be enabled if you specify a value for the <code>EngineVersion</code> parameter that's a different major version than the global cluster's current version.</p> <p>If you upgrade the major version of a global database, the cluster and DB instance parameter groups are set to the default parameter groups for the new version. Apply any custom parameter groups after completing the upgrade.</p>

    Raises:
        capo_rds.errors.global_cluster_already_exists_fault.GlobalClusterAlreadyExistsFault: <p>The <code>GlobalClusterIdentifier</code> already exists. Specify a new global database identifier (unique name) to create a new global database cluster or to rename an existing one.</p>
        capo_rds.errors.global_cluster_not_found_fault.GlobalClusterNotFoundFault: <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global database cluster.</p>
        capo_rds.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.invalid_global_cluster_state_fault.InvalidGlobalClusterStateFault: <p>The global cluster is in an invalid state and can't perform the requested operation.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To modify a global database cluster
        The following example enables deletion protection for an Aurora MySQL-based global database cluster.

        >>> await client.modify_global_cluster(global_cluster_identifier='myglobalcluster', deletion_protection=True)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.modify_global_cluster_message.ModifyGlobalClusterMessage]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.modify_global_cluster_result.ModifyGlobalClusterResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.modify_global_cluster

        (
            output,
            http_response,
        ) = await capo_rds._operations.amazon_rd_sv19.modify_global_cluster.async_modify_global_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyGlobalCluster")
    )
    input_: capo_rds.types.modify_global_cluster_message.ModifyGlobalClusterMessage = {}
    if global_cluster_identifier is not None:
        input_["global_cluster_identifier"] = global_cluster_identifier
    if new_global_cluster_identifier is not None:
        input_["new_global_cluster_identifier"] = new_global_cluster_identifier
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if allow_major_version_upgrade is not None:
        input_["allow_major_version_upgrade"] = allow_major_version_upgrade

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output