CopyProductCommand

Copies the specified source product to the specified target product or a new product.

You can copy a product to the same account or another account. You can copy a product to the same Region or another Region. If you copy a product to another account, you must first share the product in a portfolio using CreatePortfolioShare.

This operation is performed asynchronously. To track the progress of the operation, use DescribeCopyProductStatus.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ServiceCatalogClient, CopyProductCommand } from "@aws-sdk/client-service-catalog"; // ES Modules import
// const { ServiceCatalogClient, CopyProductCommand } = require("@aws-sdk/client-service-catalog"); // CommonJS import
const client = new ServiceCatalogClient(config);
const input = { // CopyProductInput
  AcceptLanguage: "STRING_VALUE",
  SourceProductArn: "STRING_VALUE", // required
  TargetProductId: "STRING_VALUE",
  TargetProductName: "STRING_VALUE",
  SourceProvisioningArtifactIdentifiers: [ // SourceProvisioningArtifactProperties
    { // SourceProvisioningArtifactPropertiesMap
      "<keys>": "STRING_VALUE",
    },
  ],
  CopyOptions: [ // CopyOptions
    "CopyTags",
  ],
  IdempotencyToken: "STRING_VALUE", // required
};
const command = new CopyProductCommand(input);
const response = await client.send(command);
// { // CopyProductOutput
//   CopyProductToken: "STRING_VALUE",
// };

CopyProductCommand Input

See CopyProductCommandInput for more details

Parameter
Type
Description
SourceProductArn
Required
string | undefined

The Amazon Resource Name (ARN) of the source product.

AcceptLanguage
string | undefined

The language code.

  • jp - Japanese

  • zh - Chinese

CopyOptions
CopyOption[] | undefined

The copy options. If the value is CopyTags, the tags from the source product are copied to the target product.

IdempotencyToken
string | undefined

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.

SourceProvisioningArtifactIdentifiers
Partial<Record<ProvisioningArtifactPropertyName, string>[] | undefined

The identifiers of the provisioning artifacts (also known as versions) of the product to copy. By default, all provisioning artifacts are copied.

TargetProductId
string | undefined

The identifier of the target product. By default, a new product is created.

TargetProductName
string | undefined

A name for the target product. The default is the name of the source product.

CopyProductCommand Output

See CopyProductCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
CopyProductToken
string | undefined

The token to use to track the progress of the operation.

Throws

Name
Fault
Details
InvalidParametersException
client

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

ResourceNotFoundException
client

The specified resource was not found.

ServiceCatalogServiceException
Base exception class for all service exceptions from ServiceCatalog service.