Skip to content

delete_environment async

delete_environment(
    name: EnvironmentName, *, config_overrides: Optional[AsyncMWAAClientConfig] = None
) -> DeleteEnvironmentOutput

Deletes an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.

Parameters:

  • name (EnvironmentName) –

    The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.

Raises:

Source code in docs_src/capo_mwaa/_services/async_mwaa.py
async def delete_environment(
    self,
    name: "capo_mwaa.types.environment_name.EnvironmentName",
    *,
    config_overrides: Optional[AsyncMWAAClientConfig] = None,
) -> "capo_mwaa.types.delete_environment_output.DeleteEnvironmentOutput":
    """<p>Deletes an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.</p>

    Args:
        name: <p>The name of the Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>

    Raises:
        capo_mwaa.errors.internal_server_exception.InternalServerException: <p>InternalServerException: An internal error has occurred.</p>
        capo_mwaa.errors.resource_not_found_exception.ResourceNotFoundException: <p>ResourceNotFoundException: The resource is not available.</p>
        capo_mwaa.errors.service_unavailable_exception.ServiceUnavailableException: <p>ServiceUnavailableException: The service is currently unavailable.</p>
        capo_mwaa.errors.validation_exception.ValidationException: <p>ValidationException: The provided input is not valid.</p>
        capo_mwaa.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mwaa.types.delete_environment_input.DeleteEnvironmentInput]",
    ) -> AsyncOperationResponse[
        "capo_mwaa.types.delete_environment_output.DeleteEnvironmentOutput"
    ]:
        import capo_mwaa._operations.amazon_mwaa.delete_environment

        (
            output,
            http_response,
        ) = await capo_mwaa._operations.amazon_mwaa.delete_environment.async_delete_environment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteEnvironment")
    )
    input_: capo_mwaa.types.delete_environment_input.DeleteEnvironmentInput = {
        "name": name
    }

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