Skip to content

terminate_provisioned_product async

terminate_provisioned_product(
    terminate_token: IdempotencyToken,
    *,
    config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
    provisioned_product_name: Optional[ProvisionedProductNameOrArn] = None,
    provisioned_product_id: Optional[Id] = None,
    ignore_errors: Optional[IgnoreErrors] = None,
    accept_language: Optional[AcceptLanguage] = None,
    retain_physical_resources: Optional[RetainPhysicalResources] = None,
) -> TerminateProvisionedProductOutput

Terminates the specified provisioned product.

This operation does not delete any records associated with the provisioned product.

You can check the status of this request using DescribeRecord.

Parameters:

  • provisioned_product_name (Optional[ProvisionedProductNameOrArn], default: None ) –

    The name of the provisioned product. You cannot specify both ProvisionedProductName and ProvisionedProductId.

  • provisioned_product_id (Optional[Id], default: None ) –

    The identifier of the provisioned product. You cannot specify both ProvisionedProductName and ProvisionedProductId.

  • terminate_token (IdempotencyToken) –

    An idempotency token that uniquely identifies the termination request. This token is only valid during the termination process. After the provisioned product is terminated, subsequent requests to terminate the same provisioned product always return ResourceNotFound.

  • ignore_errors (Optional[IgnoreErrors], default: None ) –

    If set to true, Service Catalog stops managing the specified provisioned product even if it cannot delete the underlying resources.

  • accept_language (Optional[AcceptLanguage], default: None ) –

    The language code.

    • jp - Japanese

    • zh - Chinese

  • retain_physical_resources (Optional[RetainPhysicalResources], default: None ) –

    When this boolean parameter is set to true, the TerminateProvisionedProduct API deletes the Service Catalog provisioned product. However, it does not remove the CloudFormation stack, stack set, or the underlying resources of the deleted provisioned product. The default value is false.

Raises:

Source code in docs_src/capo_service_catalog/_services/async_service_catalog.py
async def terminate_provisioned_product(
    self,
    terminate_token: "capo_service_catalog.types.idempotency_token.IdempotencyToken",
    *,
    config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
    provisioned_product_name: Optional[
        "capo_service_catalog.types.provisioned_product_name_or_arn.ProvisionedProductNameOrArn"
    ] = None,
    provisioned_product_id: Optional["capo_service_catalog.types.id.Id"] = None,
    ignore_errors: Optional[
        "capo_service_catalog.types.ignore_errors.IgnoreErrors"
    ] = None,
    accept_language: Optional[
        "capo_service_catalog.types.accept_language.AcceptLanguage"
    ] = None,
    retain_physical_resources: Optional[
        "capo_service_catalog.types.retain_physical_resources.RetainPhysicalResources"
    ] = None,
) -> "capo_service_catalog.types.terminate_provisioned_product_output.TerminateProvisionedProductOutput":
    """<p>Terminates the specified provisioned product.</p> <p>This operation does not delete any records associated with the provisioned product.</p> <p>You can check the status of this request using <a>DescribeRecord</a>.</p>

    Args:
        provisioned_product_name: <p>The name of the provisioned product. You cannot specify both <code>ProvisionedProductName</code> and <code>ProvisionedProductId</code>.</p>
        provisioned_product_id: <p>The identifier of the provisioned product. You cannot specify both <code>ProvisionedProductName</code> and <code>ProvisionedProductId</code>.</p>
        terminate_token: <p>An idempotency token that uniquely identifies the termination request. This token is only valid during the termination process. After the provisioned product is terminated, subsequent requests to terminate the same provisioned product always return <b>ResourceNotFound</b>.</p>
        ignore_errors: <p>If set to true, Service Catalog stops managing the specified provisioned product even if it cannot delete the underlying resources.</p>
        accept_language: <p>The language code.</p> <ul> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>
        retain_physical_resources: <p>When this boolean parameter is set to true, the <code>TerminateProvisionedProduct</code> API deletes the Service Catalog provisioned product. However, it does not remove the CloudFormation stack, stack set, or the underlying resources of the deleted provisioned product. The default value is false.</p>

    Raises:
        capo_service_catalog.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_service_catalog.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_service_catalog.types.terminate_provisioned_product_input.TerminateProvisionedProductInput]",
    ) -> AsyncOperationResponse[
        "capo_service_catalog.types.terminate_provisioned_product_output.TerminateProvisionedProductOutput"
    ]:
        import capo_service_catalog._operations.aws242_service_catalog_service.terminate_provisioned_product

        (
            output,
            http_response,
        ) = await capo_service_catalog._operations.aws242_service_catalog_service.terminate_provisioned_product.async_terminate_provisioned_product(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TerminateProvisionedProduct")
    )
    input_: capo_service_catalog.types.terminate_provisioned_product_input.TerminateProvisionedProductInput = {
        "terminate_token": terminate_token
    }
    if provisioned_product_name is not None:
        input_["provisioned_product_name"] = provisioned_product_name
    if provisioned_product_id is not None:
        input_["provisioned_product_id"] = provisioned_product_id
    if ignore_errors is not None:
        input_["ignore_errors"] = ignore_errors
    if accept_language is not None:
        input_["accept_language"] = accept_language
    if retain_physical_resources is not None:
        input_["retain_physical_resources"] = retain_physical_resources

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