Skip to content
GitHubXDiscord

PortfolioProductAssociation

The PortfolioProductAssociation resource allows you to associate a product with a portfolio in AWS Service Catalog. This resource is crucial for managing access to products within portfolios. For more information, refer to the AWS ServiceCatalog PortfolioProductAssociations documentation.

Create a basic association between a portfolio and a product with required properties.

import AWS from "alchemy/aws/control";
const portfolioProductAssociation = await AWS.ServiceCatalog.PortfolioProductAssociation("basicAssociation", {
PortfolioId: "portfolio-12345",
ProductId: "product-67890",
SourcePortfolioId: "source-portfolio-12345", // optional
AcceptLanguage: "en" // optional
});

Configure an association while adopting an existing resource to avoid failure if it already exists.

const advancedPortfolioProductAssociation = await AWS.ServiceCatalog.PortfolioProductAssociation("advancedAssociation", {
PortfolioId: "portfolio-54321",
ProductId: "product-09876",
SourcePortfolioId: "source-portfolio-54321", // optional
AcceptLanguage: "fr", // optional
adopt: true // adopt existing resource
});

Use the adopt option to ensure that the association will succeed even if the resource already exists.

const adoptedPortfolioProductAssociation = await AWS.ServiceCatalog.PortfolioProductAssociation("adoptedAssociation", {
PortfolioId: "portfolio-11111",
ProductId: "product-22222",
adopt: true // true to adopt existing resource
});

Create an association while specifying a different language for the operation.

const multilingualPortfolioProductAssociation = await AWS.ServiceCatalog.PortfolioProductAssociation("multilingualAssociation", {
PortfolioId: "portfolio-99999",
ProductId: "product-88888",
AcceptLanguage: "es" // Spanish
});