Skip to content
GitHubXDiscord

AcceptedPortfolioShare

The AcceptedPortfolioShare resource allows you to manage the acceptance of portfolio shares in AWS Service Catalog. For more details, you can refer to the AWS documentation: AWS ServiceCatalog AcceptedPortfolioShares.

This example demonstrates how to create a basic accepted portfolio share with required properties and an optional language setting.

import AWS from "alchemy/aws/control";
const portfolioShare = await AWS.ServiceCatalog.AcceptedPortfolioShare("portfolioShare1", {
PortfolioId: "port-1234abcd",
AcceptLanguage: "en"
});

In this example, we show how to adopt an existing resource instead of failing when the resource already exists.

const adoptedPortfolioShare = await AWS.ServiceCatalog.AcceptedPortfolioShare("portfolioShare2", {
PortfolioId: "port-5678efgh",
adopt: true
});

You can create multiple accepted portfolio shares in a single project, each configured with different parameters.

const portfolioShare1 = await AWS.ServiceCatalog.AcceptedPortfolioShare("portfolioShare1", {
PortfolioId: "port-1234abcd",
AcceptLanguage: "en"
});
const portfolioShare2 = await AWS.ServiceCatalog.AcceptedPortfolioShare("portfolioShare2", {
PortfolioId: "port-5678efgh",
AcceptLanguage: "fr",
adopt: true
});

This example illustrates how to access additional properties such as ARN and timestamps after creating the accepted portfolio share.

const acceptedShareDetails = await AWS.ServiceCatalog.AcceptedPortfolioShare("portfolioShareDetails", {
PortfolioId: "port-91011ijkl"
});
// Accessing additional properties
console.log(`ARN: ${acceptedShareDetails.Arn}`);
console.log(`Created At: ${acceptedShareDetails.CreationTime}`);
console.log(`Last Updated At: ${acceptedShareDetails.LastUpdateTime}`);