Skip to content

delete_application async

delete_application(
    application_name: ApplicationName,
    *,
    config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
    terminate_env_by_force: Optional[TerminateEnvForce] = None,
) -> None

Deletes the specified application along with all associated versions and configurations. The application versions will not be deleted from your Amazon S3 bucket.

You cannot delete an application that has a running environment.

Parameters:

  • application_name (ApplicationName) –

    The name of the application to delete.

  • terminate_env_by_force (Optional[TerminateEnvForce], default: None ) –

    When set to true, running environments will be terminated before deleting the application.

Raises:

  • OperationInProgressException –

    Unable to perform the specified operation because another operation that effects an element in this activity is already in progress.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To delete an application The following operation deletes an application named my-app:

>>> await client.delete_application(application_name='my-app')
Source code in docs_src/capo_elastic_beanstalk/_services/async_elastic_beanstalk.py
async def delete_application(
    self,
    application_name: "capo_elastic_beanstalk.types.application_name.ApplicationName",
    *,
    config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
    terminate_env_by_force: Optional[
        "capo_elastic_beanstalk.types.terminate_env_force.TerminateEnvForce"
    ] = None,
) -> None:
    """<p>Deletes the specified application along with all associated versions and configurations. The application versions will not be deleted from your Amazon S3 bucket.</p> <note> <p>You cannot delete an application that has a running environment.</p> </note>

    Args:
        application_name: <p>The name of the application to delete.</p>
        terminate_env_by_force: <p>When set to true, running environments will be terminated before deleting the application.</p>

    Raises:
        capo_elastic_beanstalk.errors.operation_in_progress_exception.OperationInProgressException: <p>Unable to perform the specified operation because another operation that effects an element in this activity is already in progress.</p>
        capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete an application
        The following operation deletes an application named my-app:

        >>> await client.delete_application(application_name='my-app')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elastic_beanstalk.types.delete_application_message.DeleteApplicationMessage]",
    ) -> AsyncOperationResponse[None]:
        import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.delete_application

        (
            output,
            http_response,
        ) = await capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.delete_application.async_delete_application(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteApplication")
    )
    input_: capo_elastic_beanstalk.types.delete_application_message.DeleteApplicationMessage = {
        "application_name": application_name
    }
    if terminate_env_by_force is not None:
        input_["terminate_env_by_force"] = terminate_env_by_force

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