Skip to content

delete_blue_green_deployment async

delete_blue_green_deployment(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    blue_green_deployment_identifier: Optional[BlueGreenDeploymentIdentifier] = None,
    delete_target: Optional[BooleanOptional] = None,
) -> DeleteBlueGreenDeploymentResponse

Deletes a blue/green deployment.

For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide.

Parameters:

  • blue_green_deployment_identifier (Optional[BlueGreenDeploymentIdentifier], default: None ) –

    The unique identifier of the blue/green deployment to delete. This parameter isn't case-sensitive.

    Constraints:

    • Must match an existing blue/green deployment identifier.

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

    Specifies whether to delete the resources in the green environment. You can't specify this option if the blue/green deployment status is SWITCHOVER_COMPLETED.

Raises:

Examples:

To delete resources in green environment for an RDS for MySQL DB instance The following example deletes the resources in a green environment for an RDS for MySQL DB instance.

>>> await client.delete_blue_green_deployment(blue_green_deployment_identifier='bgd-v53303651eexfake', delete_target=True)
To delete resources in green environment for an Aurora MySQL DB cluster
The following example deletes the resources in a green environment for an Aurora MySQL DB cluster.
>>> await client.delete_blue_green_deployment(blue_green_deployment_identifier='bgd-wi89nwzglccsfake', delete_target=True)
Source code in docs_src/capo_rds/_services/async_rds.py
async def delete_blue_green_deployment(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    blue_green_deployment_identifier: Optional[
        "capo_rds.types.blue_green_deployment_identifier.BlueGreenDeploymentIdentifier"
    ] = None,
    delete_target: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_rds.types.delete_blue_green_deployment_response.DeleteBlueGreenDeploymentResponse":
    """<p>Deletes a blue/green deployment.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments.html">Using Amazon RDS Blue/Green Deployments for database updates</a> in the <i>Amazon RDS User Guide</i> and <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html">Using Amazon RDS Blue/Green Deployments for database updates</a> in the <i>Amazon Aurora User Guide</i>.</p>

    Args:
        blue_green_deployment_identifier: <p>The unique identifier of the blue/green deployment to delete. This parameter isn't case-sensitive.</p> <p>Constraints: </p> <ul> <li> <p>Must match an existing blue/green deployment identifier.</p> </li> </ul>
        delete_target: <p>Specifies whether to delete the resources in the green environment. You can't specify this option if the blue/green deployment <a href="https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_BlueGreenDeployment.html">status</a> is <code>SWITCHOVER_COMPLETED</code>.</p>

    Raises:
        capo_rds.errors.blue_green_deployment_not_found_fault.BlueGreenDeploymentNotFoundFault: <p> <code>BlueGreenDeploymentIdentifier</code> doesn't refer to an existing blue/green deployment.</p>
        capo_rds.errors.invalid_blue_green_deployment_state_fault.InvalidBlueGreenDeploymentStateFault: <p>The blue/green deployment can't be switched over or deleted because there is an invalid configuration in the green environment.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete resources in green environment for an RDS for MySQL DB instance
        The following example deletes the resources in a green environment for an RDS for MySQL DB instance.

        >>> await client.delete_blue_green_deployment(blue_green_deployment_identifier='bgd-v53303651eexfake', delete_target=True)
        To delete resources in green environment for an Aurora MySQL DB cluster
        The following example deletes the resources in a green environment for an Aurora MySQL DB cluster.

        >>> await client.delete_blue_green_deployment(blue_green_deployment_identifier='bgd-wi89nwzglccsfake', delete_target=True)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.delete_blue_green_deployment_request.DeleteBlueGreenDeploymentRequest]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.delete_blue_green_deployment_response.DeleteBlueGreenDeploymentResponse"
    ]:
        import capo_rds._operations.amazon_rd_sv19.delete_blue_green_deployment

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteBlueGreenDeployment")
    )
    input_: capo_rds.types.delete_blue_green_deployment_request.DeleteBlueGreenDeploymentRequest = {}
    if blue_green_deployment_identifier is not None:
        input_["blue_green_deployment_identifier"] = (
            blue_green_deployment_identifier
        )
    if delete_target is not None:
        input_["delete_target"] = delete_target

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