Skip to content

create_product async

create_product(
    name: ProductViewName,
    owner: ProductViewOwner,
    product_type: ProductType,
    idempotency_token: IdempotencyToken,
    *,
    config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
    accept_language: Optional[AcceptLanguage] = None,
    description: Optional[ProductViewShortDescription] = None,
    distributor: Optional[ProductViewOwner] = None,
    support_description: Optional[SupportDescription] = None,
    support_email: Optional[SupportEmail] = None,
    support_url: Optional[SupportUrl] = None,
    tags: Optional[AddTags] = None,
    provisioning_artifact_parameters: Optional[ProvisioningArtifactProperties] = None,
    source_connection: Optional[SourceConnection] = None,
) -> CreateProductOutput

Creates a product.

A delegated admin is authorized to invoke this command.

The user or role that performs this operation must have the cloudformation:GetTemplate IAM policy permission. This policy permission is required when using the ImportFromPhysicalId template source in the information data section.

Parameters:

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

    The language code.

    • jp - Japanese

    • zh - Chinese

  • name (ProductViewName) –

    The name of the product.

  • owner (ProductViewOwner) –

    The owner of the product.

  • description (Optional[ProductViewShortDescription], default: None ) –

    The description of the product.

  • distributor (Optional[ProductViewOwner], default: None ) –

    The distributor of the product.

  • support_description (Optional[SupportDescription], default: None ) –

    The support information about the product.

  • support_email (Optional[SupportEmail], default: None ) –

    The contact email for product support.

  • support_url (Optional[SupportUrl], default: None ) –

    The contact URL for product support.

    ^https?:\/\// / is the pattern used to validate SupportUrl.

  • product_type (ProductType) –

    The type of product.

  • tags (Optional[AddTags], default: None ) –

    One or more tags.

  • provisioning_artifact_parameters (Optional[ProvisioningArtifactProperties], default: None ) –

    The configuration of the provisioning artifact.

  • 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.

  • source_connection (Optional[SourceConnection], default: None ) –

    Specifies connection details for the created product and syncs the product to the connection source artifact. This automatically manages the product's artifacts based on changes to the source. The SourceConnection parameter consists of the following sub-fields.

    • Type

    • ConnectionParamters

Raises:

  • InvalidParametersException –

    One or more parameters provided to the operation are not valid.

  • LimitExceededException –

    The current limits of the service would have been exceeded by this operation. Decrease your resource use or increase your service limits and retry the operation.

  • TagOptionNotMigratedException –

    An operation requiring TagOptions failed because the TagOptions migration process has not been performed for this account. Use the Amazon Web Services Management Console to perform the migration process before retrying the operation.

  • UnknownServiceError –

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

Source code in docs_src/capo_service_catalog/_services/async_service_catalog.py
async def create_product(
    self,
    name: "capo_service_catalog.types.product_view_name.ProductViewName",
    owner: "capo_service_catalog.types.product_view_owner.ProductViewOwner",
    product_type: "capo_service_catalog.types.product_type.ProductType",
    idempotency_token: "capo_service_catalog.types.idempotency_token.IdempotencyToken",
    *,
    config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
    accept_language: Optional[
        "capo_service_catalog.types.accept_language.AcceptLanguage"
    ] = None,
    description: Optional[
        "capo_service_catalog.types.product_view_short_description.ProductViewShortDescription"
    ] = None,
    distributor: Optional[
        "capo_service_catalog.types.product_view_owner.ProductViewOwner"
    ] = None,
    support_description: Optional[
        "capo_service_catalog.types.support_description.SupportDescription"
    ] = None,
    support_email: Optional[
        "capo_service_catalog.types.support_email.SupportEmail"
    ] = None,
    support_url: Optional[
        "capo_service_catalog.types.support_url.SupportUrl"
    ] = None,
    tags: Optional["capo_service_catalog.types.add_tags.AddTags"] = None,
    provisioning_artifact_parameters: Optional[
        "capo_service_catalog.types.provisioning_artifact_properties.ProvisioningArtifactProperties"
    ] = None,
    source_connection: Optional[
        "capo_service_catalog.types.source_connection.SourceConnection"
    ] = None,
) -> "capo_service_catalog.types.create_product_output.CreateProductOutput":
    r"""<p>Creates a product.</p> <p>A delegated admin is authorized to invoke this command.</p> <p>The user or role that performs this operation must have the <code>cloudformation:GetTemplate</code> IAM policy permission. This policy permission is required when using the <code>ImportFromPhysicalId</code> template source in the information data section.</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>
        name: <p>The name of the product.</p>
        owner: <p>The owner of the product.</p>
        description: <p>The description of the product.</p>
        distributor: <p>The distributor of the product.</p>
        support_description: <p>The support information about the product.</p>
        support_email: <p>The contact email for product support.</p>
        support_url: <p>The contact URL for product support.</p> <p> <code>^https?:\/\// </code>/ is the pattern used to validate SupportUrl.</p>
        product_type: <p>The type of product.</p>
        tags: <p>One or more tags.</p>
        provisioning_artifact_parameters: <p>The configuration of the provisioning artifact. </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>
        source_connection: <p>Specifies connection details for the created product and syncs the product to the connection source artifact. This automatically manages the product's artifacts based on changes to the source. The <code>SourceConnection</code> parameter consists of the following sub-fields.</p> <ul> <li> <p> <code>Type</code> </p> </li> <li> <p> <code>ConnectionParamters</code> </p> </li> </ul>

    Raises:
        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.limit_exceeded_exception.LimitExceededException: <p>The current limits of the service would have been exceeded by this operation. Decrease your resource use or increase your service limits and retry the operation.</p>
        capo_service_catalog.errors.tag_option_not_migrated_exception.TagOptionNotMigratedException: <p>An operation requiring TagOptions failed because the TagOptions migration process has not been performed for this account. Use the Amazon Web Services Management Console to perform the migration process before retrying the operation.</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.create_product_input.CreateProductInput]",
    ) -> AsyncOperationResponse[
        "capo_service_catalog.types.create_product_output.CreateProductOutput"
    ]:
        import capo_service_catalog._operations.aws242_service_catalog_service.create_product

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateProduct")
    )
    input_: capo_service_catalog.types.create_product_input.CreateProductInput = {
        "name": name,
        "owner": owner,
        "product_type": product_type,
        "idempotency_token": idempotency_token,
    }
    if accept_language is not None:
        input_["accept_language"] = accept_language
    if description is not None:
        input_["description"] = description
    if distributor is not None:
        input_["distributor"] = distributor
    if support_description is not None:
        input_["support_description"] = support_description
    if support_email is not None:
        input_["support_email"] = support_email
    if support_url is not None:
        input_["support_url"] = support_url
    if tags is not None:
        input_["tags"] = tags
    if provisioning_artifact_parameters is not None:
        input_["provisioning_artifact_parameters"] = (
            provisioning_artifact_parameters
        )
    if source_connection is not None:
        input_["source_connection"] = source_connection

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