Skip to content

import_as_provisioned_product

import_as_provisioned_product(
    product_id: Id,
    provisioning_artifact_id: Id,
    provisioned_product_name: ProvisionedProductName,
    physical_id: PhysicalId,
    idempotency_token: IdempotencyToken,
    *,
    config_overrides: Optional[ServiceCatalogClientConfig] = None,
    accept_language: Optional[AcceptLanguage] = None,
) -> ImportAsProvisionedProductOutput

Requests the import of a resource as an Service Catalog provisioned product that is associated to an Service Catalog product and provisioning artifact. Once imported, all supported governance actions are supported on the provisioned product.

Resource import only supports CloudFormation stack ARNs. CloudFormation StackSets, and non-root nested stacks, are not supported.

The CloudFormation stack must have one of the following statuses to be imported: CREATE_COMPLETE, UPDATE_COMPLETE, UPDATE_ROLLBACK_COMPLETE, IMPORT_COMPLETE, and IMPORT_ROLLBACK_COMPLETE.

Import of the resource requires that the CloudFormation stack template matches the associated Service Catalog product provisioning artifact.

When you import an existing CloudFormation stack into a portfolio, Service Catalog does not apply the product's associated constraints during the import process. Service Catalog applies the constraints after you call UpdateProvisionedProduct for the provisioned product.

The user or role that performs this operation must have the cloudformation:GetTemplate and cloudformation:DescribeStacks IAM policy permissions.

You can only import one provisioned product at a time. The product's CloudFormation stack must have the IMPORT_COMPLETE status before you import another.

Parameters:

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

    The language code.

    • jp - Japanese

    • zh - Chinese

  • product_id (Id) –

    The product identifier.

  • provisioning_artifact_id (Id) –

    The identifier of the provisioning artifact.

  • provisioned_product_name (ProvisionedProductName) –

    The user-friendly name of the provisioned product. The value must be unique for the Amazon Web Services account. The name cannot be updated after the product is provisioned.

  • physical_id (PhysicalId) –

    The unique identifier of the resource to be imported. It only currently supports CloudFormation stack IDs.

  • idempotency_token (IdempotencyToken) –

    A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.

Raises:

Source code in docs_src/capo_service_catalog/_services/service_catalog.py
def import_as_provisioned_product(
    self,
    product_id: "capo_service_catalog.types.id.Id",
    provisioning_artifact_id: "capo_service_catalog.types.id.Id",
    provisioned_product_name: "capo_service_catalog.types.provisioned_product_name.ProvisionedProductName",
    physical_id: "capo_service_catalog.types.physical_id.PhysicalId",
    idempotency_token: "capo_service_catalog.types.idempotency_token.IdempotencyToken",
    *,
    config_overrides: Optional[ServiceCatalogClientConfig] = None,
    accept_language: Optional[
        "capo_service_catalog.types.accept_language.AcceptLanguage"
    ] = None,
) -> "capo_service_catalog.types.import_as_provisioned_product_output.ImportAsProvisionedProductOutput":
    """<p> Requests the import of a resource as an Service Catalog provisioned product that is associated to an Service Catalog product and provisioning artifact. Once imported, all supported governance actions are supported on the provisioned product. </p> <p> Resource import only supports CloudFormation stack ARNs. CloudFormation StackSets, and non-root nested stacks, are not supported. </p> <p> The CloudFormation stack must have one of the following statuses to be imported: <code>CREATE_COMPLETE</code>, <code>UPDATE_COMPLETE</code>, <code>UPDATE_ROLLBACK_COMPLETE</code>, <code>IMPORT_COMPLETE</code>, and <code>IMPORT_ROLLBACK_COMPLETE</code>. </p> <p> Import of the resource requires that the CloudFormation stack template matches the associated Service Catalog product provisioning artifact. </p> <note> <p> When you import an existing CloudFormation stack into a portfolio, Service Catalog does not apply the product's associated constraints during the import process. Service Catalog applies the constraints after you call <code>UpdateProvisionedProduct</code> for the provisioned product. </p> </note> <p> The user or role that performs this operation must have the <code>cloudformation:GetTemplate</code> and <code>cloudformation:DescribeStacks</code> IAM policy permissions. </p> <p>You can only import one provisioned product at a time. The product's CloudFormation stack must have the <code>IMPORT_COMPLETE</code> status before you import another. </p>

    Args:
        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>
        product_id: <p>The product identifier.</p>
        provisioning_artifact_id: <p>The identifier of the provisioning artifact.</p>
        provisioned_product_name: <p>The user-friendly name of the provisioned product. The value must be unique for the Amazon Web Services account. The name cannot be updated after the product is provisioned. </p>
        physical_id: <p>The unique identifier of the resource to be imported. It only currently supports CloudFormation stack IDs.</p>
        idempotency_token: <p>A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.</p>

    Raises:
        capo_service_catalog.errors.duplicate_resource_exception.DuplicateResourceException: <p>The specified resource is a duplicate.</p>
        capo_service_catalog.errors.invalid_parameters_exception.InvalidParametersException: <p>One or more parameters provided to the operation are not valid.</p>
        capo_service_catalog.errors.invalid_state_exception.InvalidStateException: <p>An attempt was made to modify a resource that is in a state that is not valid. Check your resources to ensure that they are in valid states before retrying the operation.</p>
        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.
    """

    def _handler(
        req: "OperationRequest[capo_service_catalog.types.import_as_provisioned_product_input.ImportAsProvisionedProductInput]",
    ) -> OperationResponse[
        "capo_service_catalog.types.import_as_provisioned_product_output.ImportAsProvisionedProductOutput"
    ]:
        import capo_service_catalog._operations.aws242_service_catalog_service.import_as_provisioned_product

        output, http_response = (
            capo_service_catalog._operations.aws242_service_catalog_service.import_as_provisioned_product.import_as_provisioned_product(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportAsProvisionedProduct")
    )
    input_: capo_service_catalog.types.import_as_provisioned_product_input.ImportAsProvisionedProductInput = {
        "product_id": product_id,
        "provisioning_artifact_id": provisioning_artifact_id,
        "provisioned_product_name": provisioned_product_name,
        "physical_id": physical_id,
        "idempotency_token": idempotency_token,
    }
    if accept_language is not None:
        input_["accept_language"] = accept_language

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output