Skip to content

remove_alias async

remove_alias(
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    alias_name: Optional[AliasName] = None,
) -> None

Removes an alias from a stack. After the alias is removed successfully, it can no longer be used to reference the stack in API calls.

Parameters:

Raises:

Examples:

Example – Remove an alias from a stack The following example removes the alias MyAlias from your stack:

>>> await client.remove_alias(alias_name='MyAlias')
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
async def remove_alias(
    self,
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    alias_name: Optional["capo_cloudformation.types.alias_name.AliasName"] = None,
) -> None:
    """<p>Removes an alias from a stack. After the alias is removed successfully, it can no longer be used to reference the stack in API calls.</p>

    Args:
        alias_name: <p>The alias name to remove.</p>

    Raises:
        capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Example – Remove an alias from a stack
        The following example removes the alias MyAlias from your stack:

        >>> await client.remove_alias(alias_name='MyAlias')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudformation.types.remove_alias_input.RemoveAliasInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_cloudformation._operations.cloud_formation.remove_alias

        (
            output,
            http_response,
        ) = await capo_cloudformation._operations.cloud_formation.remove_alias.async_remove_alias(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemoveAlias")
    )
    input_: capo_cloudformation.types.remove_alias_input.RemoveAliasInput = {}
    if alias_name is not None:
        input_["alias_name"] = alias_name

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