ServiceCatalog / Client / create_product

create_product#

ServiceCatalog.Client.create_product(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.create_product(
    AcceptLanguage='string',
    Name='string',
    Owner='string',
    Description='string',
    Distributor='string',
    SupportDescription='string',
    SupportEmail='string',
    SupportUrl='string',
    ProductType='CLOUD_FORMATION_TEMPLATE'|'MARKETPLACE'|'TERRAFORM_OPEN_SOURCE'|'TERRAFORM_CLOUD'|'EXTERNAL',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    ProvisioningArtifactParameters={
        'Name': 'string',
        'Description': 'string',
        'Info': {
            'string': 'string'
        },
        'Type': 'CLOUD_FORMATION_TEMPLATE'|'MARKETPLACE_AMI'|'MARKETPLACE_CAR'|'TERRAFORM_OPEN_SOURCE'|'TERRAFORM_CLOUD'|'EXTERNAL',
        'DisableTemplateValidation': True|False
    },
    IdempotencyToken='string',
    SourceConnection={
        'Type': 'CODESTAR',
        'ConnectionParameters': {
            'CodeStar': {
                'ConnectionArn': 'string',
                'Repository': 'string',
                'Branch': 'string',
                'ArtifactPath': 'string'
            }
        }
    }
)
Parameters:
  • AcceptLanguage (string) –

    The language code.

    • jp - Japanese

    • zh - Chinese

  • Name (string) –

    [REQUIRED]

    The name of the product.

  • Owner (string) –

    [REQUIRED]

    The owner of the product.

  • Description (string) – The description of the product.

  • Distributor (string) – The distributor of the product.

  • SupportDescription (string) – The support information about the product.

  • SupportEmail (string) – The contact email for product support.

  • SupportUrl (string) –

    The contact URL for product support.

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

  • ProductType (string) –

    [REQUIRED]

    The type of product.

  • Tags (list) –

    One or more tags.

    • (dict) –

      Information about a tag. A tag is a key-value pair. Tags are propagated to the resources created when provisioning a product.

      • Key (string) – [REQUIRED]

        The tag key.

      • Value (string) – [REQUIRED]

        The value for this key.

  • ProvisioningArtifactParameters (dict) –

    The configuration of the provisioning artifact.

    • Name (string) –

      The name of the provisioning artifact (for example, v1 v2beta). No spaces are allowed.

    • Description (string) –

      The description of the provisioning artifact, including how it differs from the previous provisioning artifact.

    • Info (dict) –

      Specify the template source with one of the following options, but not both. Keys accepted: [ LoadTemplateFromURL, ImportFromPhysicalId ]

      The URL of the CloudFormation template in Amazon S3 or GitHub in JSON format. Specify the URL in JSON format as follows:

      "LoadTemplateFromURL": "https://s3.amazonaws.com/cf-templates-ozkq9d3hgiq2-us-east-1/..."

      ImportFromPhysicalId: The physical id of the resource that contains the template. Currently only supports CloudFormation stack arn. Specify the physical id in JSON format as follows: ImportFromPhysicalId: “arn:aws:cloudformation:[us-east-1]:[accountId]:stack/[StackName]/[resourceId]

      • (string) –

        • (string) –

    • Type (string) –

      The type of provisioning artifact.

      • CLOUD_FORMATION_TEMPLATE - CloudFormation template

      • TERRAFORM_OPEN_SOURCE - Terraform Open Source configuration file

      • TERRAFORM_CLOUD - Terraform Cloud configuration file

      • EXTERNAL - External configuration file

    • DisableTemplateValidation (boolean) –

      If set to true, Service Catalog stops validating the specified provisioning artifact even if it is invalid.

      Service Catalog does not support template validation for the TERRAFORM_OS product type.

  • IdempotencyToken (string) –

    [REQUIRED]

    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.

    This field is autopopulated if not provided.

  • SourceConnection (dict) –

    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

    • Type (string) –

      The only supported SourceConnection type is Codestar.

    • ConnectionParameters (dict) – [REQUIRED]

      The connection details based on the connection Type.

      • CodeStar (dict) –

        Provides ConnectionType details.

        • ConnectionArn (string) – [REQUIRED]

          The CodeStar ARN, which is the connection between Service Catalog and the external repository.

        • Repository (string) – [REQUIRED]

          The specific repository where the product’s artifact-to-be-synced resides, formatted as “Account/Repo.”

        • Branch (string) – [REQUIRED]

          The specific branch where the artifact resides.

        • ArtifactPath (string) – [REQUIRED]

          The absolute path wehre the artifact resides within the repo and branch, formatted as “folder/file.json.”

Return type:

dict

Returns:

Response Syntax

{
    'ProductViewDetail': {
        'ProductViewSummary': {
            'Id': 'string',
            'ProductId': 'string',
            'Name': 'string',
            'Owner': 'string',
            'ShortDescription': 'string',
            'Type': 'CLOUD_FORMATION_TEMPLATE'|'MARKETPLACE'|'TERRAFORM_OPEN_SOURCE'|'TERRAFORM_CLOUD'|'EXTERNAL',
            'Distributor': 'string',
            'HasDefaultPath': True|False,
            'SupportEmail': 'string',
            'SupportDescription': 'string',
            'SupportUrl': 'string'
        },
        'Status': 'AVAILABLE'|'CREATING'|'FAILED',
        'ProductARN': 'string',
        'CreatedTime': datetime(2015, 1, 1),
        'SourceConnection': {
            'Type': 'CODESTAR',
            'ConnectionParameters': {
                'CodeStar': {
                    'ConnectionArn': 'string',
                    'Repository': 'string',
                    'Branch': 'string',
                    'ArtifactPath': 'string'
                }
            },
            'LastSync': {
                'LastSyncTime': datetime(2015, 1, 1),
                'LastSyncStatus': 'SUCCEEDED'|'FAILED',
                'LastSyncStatusMessage': 'string',
                'LastSuccessfulSyncTime': datetime(2015, 1, 1),
                'LastSuccessfulSyncProvisioningArtifactId': 'string'
            }
        }
    },
    'ProvisioningArtifactDetail': {
        'Id': 'string',
        'Name': 'string',
        'Description': 'string',
        'Type': 'CLOUD_FORMATION_TEMPLATE'|'MARKETPLACE_AMI'|'MARKETPLACE_CAR'|'TERRAFORM_OPEN_SOURCE'|'TERRAFORM_CLOUD'|'EXTERNAL',
        'CreatedTime': datetime(2015, 1, 1),
        'Active': True|False,
        'Guidance': 'DEFAULT'|'DEPRECATED',
        'SourceRevision': 'string'
    },
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • ProductViewDetail (dict) –

      Information about the product view.

      • ProductViewSummary (dict) –

        Summary information about the product view.

        • Id (string) –

          The product view identifier.

        • ProductId (string) –

          The product identifier.

        • Name (string) –

          The name of the product.

        • Owner (string) –

          The owner of the product. Contact the product administrator for the significance of this value.

        • ShortDescription (string) –

          Short description of the product.

        • Type (string) –

          The product type. Contact the product administrator for the significance of this value. If this value is MARKETPLACE, the product was created by Amazon Web Services Marketplace.

        • Distributor (string) –

          The distributor of the product. Contact the product administrator for the significance of this value.

        • HasDefaultPath (boolean) –

          Indicates whether the product has a default path. If the product does not have a default path, call ListLaunchPaths to disambiguate between paths. Otherwise, ListLaunchPaths is not required, and the output of ProductViewSummary can be used directly with DescribeProvisioningParameters.

        • SupportEmail (string) –

          The email contact information to obtain support for this Product.

        • SupportDescription (string) –

          The description of the support for this Product.

        • SupportUrl (string) –

          The URL information to obtain support for this Product.

      • Status (string) –

        The status of the product.

        • AVAILABLE - The product is ready for use.

        • CREATING - Product creation has started; the product is not ready for use.

        • FAILED - An action failed.

      • ProductARN (string) –

        The ARN of the product.

      • CreatedTime (datetime) –

        The UTC time stamp of the creation time.

      • SourceConnection (dict) –

        A top level ProductViewDetail response containing details about the product’s connection. Service Catalog returns this field for the CreateProduct, UpdateProduct, DescribeProductAsAdmin, and SearchProductAsAdmin APIs. This response contains the same fields as the ConnectionParameters request, with the addition of the LastSync response.

        • Type (string) –

          The only supported SourceConnection type is Codestar.

        • ConnectionParameters (dict) –

          The connection details based on the connection Type.

          • CodeStar (dict) –

            Provides ConnectionType details.

            • ConnectionArn (string) –

              The CodeStar ARN, which is the connection between Service Catalog and the external repository.

            • Repository (string) –

              The specific repository where the product’s artifact-to-be-synced resides, formatted as “Account/Repo.”

            • Branch (string) –

              The specific branch where the artifact resides.

            • ArtifactPath (string) –

              The absolute path wehre the artifact resides within the repo and branch, formatted as “folder/file.json.”

        • LastSync (dict) –

          Provides details about the product’s connection sync and contains the following sub-fields.

          • LastSyncTime

          • LastSyncStatus

          • LastSyncStatusMessage

          • LastSuccessfulSyncTime

          • LastSuccessfulSyncProvisioningArtifactID

          • LastSyncTime (datetime) –

            The time of the last attempted sync from the repository to the Service Catalog product.

          • LastSyncStatus (string) –

            The current status of the sync. Responses include SUCCEEDED or FAILED.

          • LastSyncStatusMessage (string) –

            The sync’s status message.

          • LastSuccessfulSyncTime (datetime) –

            The time of the latest successful sync from the source repo artifact to the Service Catalog product.

          • LastSuccessfulSyncProvisioningArtifactId (string) –

            The ProvisioningArtifactID of the ProvisioningArtifact created from the latest successful sync.

    • ProvisioningArtifactDetail (dict) –

      Information about the provisioning artifact.

      • Id (string) –

        The identifier of the provisioning artifact.

      • Name (string) –

        The name of the provisioning artifact.

      • Description (string) –

        The description of the provisioning artifact.

      • Type (string) –

        The type of provisioning artifact.

        • CLOUD_FORMATION_TEMPLATE - CloudFormation template

        • TERRAFORM_OPEN_SOURCE - Terraform Open Source configuration file

        • TERRAFORM_CLOUD - Terraform Cloud configuration file

        • EXTERNAL - External configuration file

      • CreatedTime (datetime) –

        The UTC time stamp of the creation time.

      • Active (boolean) –

        Indicates whether the product version is active.

      • Guidance (string) –

        Information set by the administrator to provide guidance to end users about which provisioning artifacts to use.

      • SourceRevision (string) –

        Specifies the revision of the external artifact that was used to automatically sync the Service Catalog product and create the provisioning artifact. Service Catalog includes this response parameter as a high level field to the existing ProvisioningArtifactDetail type, which is returned as part of the response for CreateProduct, UpdateProduct, DescribeProductAsAdmin, DescribeProvisioningArtifact, ListProvisioningArtifact, and UpdateProvisioningArticat APIs.

        This field only exists for Repo-Synced products.

    • Tags (list) –

      Information about the tags associated with the product.

      • (dict) –

        Information about a tag. A tag is a key-value pair. Tags are propagated to the resources created when provisioning a product.

        • Key (string) –

          The tag key.

        • Value (string) –

          The value for this key.

Exceptions

  • ServiceCatalog.Client.exceptions.InvalidParametersException

  • ServiceCatalog.Client.exceptions.LimitExceededException

  • ServiceCatalog.Client.exceptions.TagOptionNotMigratedException