Skip to content

delete_launch_configuration async

delete_launch_configuration(
    *,
    config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
    launch_configuration_name: Optional[XmlStringMaxLen255] = None,
) -> None

Deletes the specified launch configuration.

The launch configuration must not be attached to an Auto Scaling group. When this call completes, the launch configuration is no longer available for use.

Parameters:

Raises:

  • ResourceContentionFault –

    You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).

  • ResourceInUseFault –

    The operation can't be performed because the resource is in use.

  • UnknownServiceError –

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

Examples:

To delete a launch configuration This example deletes the specified launch configuration.

>>> await client.delete_launch_configuration(launch_configuration_name='my-launch-config')
Source code in docs_src/capo_auto_scaling/_services/async_auto_scaling.py
async def delete_launch_configuration(
    self,
    *,
    config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
    launch_configuration_name: Optional[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ] = None,
) -> None:
    """<p>Deletes the specified launch configuration.</p> <p>The launch configuration must not be attached to an Auto Scaling group. When this call completes, the launch configuration is no longer available for use.</p>

    Args:
        launch_configuration_name: <p>The name of the launch configuration.</p>

    Raises:
        capo_auto_scaling.errors.resource_contention_fault.ResourceContentionFault: <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>
        capo_auto_scaling.errors.resource_in_use_fault.ResourceInUseFault: <p>The operation can't be performed because the resource is in use.</p>
        capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete a launch configuration
        This example deletes the specified launch configuration.

        >>> await client.delete_launch_configuration(launch_configuration_name='my-launch-config')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_auto_scaling.types.launch_configuration_name_type.LaunchConfigurationNameType]",
    ) -> AsyncOperationResponse[None]:
        import capo_auto_scaling._operations.auto_scaling_2011_01_01.delete_launch_configuration

        (
            output,
            http_response,
        ) = await capo_auto_scaling._operations.auto_scaling_2011_01_01.delete_launch_configuration.async_delete_launch_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteLaunchConfiguration")
    )
    input_: capo_auto_scaling.types.launch_configuration_name_type.LaunchConfigurationNameType = {}
    if launch_configuration_name is not None:
        input_["launch_configuration_name"] = launch_configuration_name

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