aws-cdk-lib.aws_servicecatalog.Portfolio

class Portfolio (construct)

LanguageType name
.NETAmazon.CDK.AWS.Servicecatalog.Portfolio
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsservicecatalog#Portfolio
Javasoftware.amazon.awscdk.services.servicecatalog.Portfolio
Pythonaws_cdk.aws_servicecatalog.Portfolio
TypeScript (source)aws-cdk-lib » aws_servicecatalog » Portfolio

Implements IConstruct, IDependable, IResource, IPortfolio

A Service Catalog portfolio.

Example

new servicecatalog.Portfolio(this, 'Portfolio', {
  displayName: 'MyPortfolio',
  providerName: 'MyTeam',
});

Initializer

new Portfolio(scope: Construct, id: string, props: PortfolioProps)

Parameters

  • scope Construct
  • id string
  • props PortfolioProps

Construct Props

NameTypeDescription
displayNamestringThe name of the portfolio.
providerNamestringThe provider name.
description?stringDescription for portfolio.
messageLanguage?MessageLanguageThe message language.
tagOptions?TagOptionsTagOptions associated directly to a portfolio.

displayName

Type: string

The name of the portfolio.


providerName

Type: string

The provider name.


description?

Type: string (optional, default: No description provided)

Description for portfolio.


messageLanguage?

Type: MessageLanguage (optional, default: English)

The message language.

Controls language for status logging and errors.


tagOptions?

Type: TagOptions (optional, default: No tagOptions provided)

TagOptions associated directly to a portfolio.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
portfolioArnstringThe ARN of the portfolio.
portfolioIdstringThe ID of the portfolio.
stackStackThe stack in which this resource is defined.

env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


portfolioArn

Type: string

The ARN of the portfolio.


portfolioId

Type: string

The ID of the portfolio.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
addProduct(product)Associate portfolio with the given product.
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
associateTagOptions(tagOptions)Associate Tag Options.
constrainCloudFormationParameters(product, options)Set provisioning rules for the product.
constrainTagUpdates(product, options?)Add a Resource Update Constraint.
deployWithStackSets(product, options)Configure deployment options using AWS Cloudformation StackSets.
giveAccessToGroup(group)Associate portfolio with an IAM Group.
giveAccessToRole(role)Associate portfolio with an IAM Role.
giveAccessToUser(user)Associate portfolio with an IAM User.
notifyOnStackEvents(product, topic, options?)Add notifications for supplied topics on the provisioned product.
setLaunchRole(product, launchRole, options?)Force users to assume a certain role when launching a product.
setLocalLaunchRole(product, launchRole, options?)Force users to assume a certain role when launching a product.
setLocalLaunchRoleName(product, launchRoleName, options?)Force users to assume a certain role when launching a product.
shareWithAccount(accountId, options?)Initiate a portfolio share with another account.
toString()Returns a string representation of this construct.
protected addBucketPermissionsToSharedAccounts()Gives access to Asset Buckets to Shared Accounts.
protected generateUniqueHash(value)Create a unique id based off the L1 CfnPortfolio or the arn of an imported portfolio.
static fromPortfolioArn(scope, id, portfolioArn)Creates a Portfolio construct that represents an external portfolio.

addProduct(product)

public addProduct(product: IProduct): void

Parameters

  • product IProduct

Associate portfolio with the given product.


applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


associateTagOptions(tagOptions)

public associateTagOptions(tagOptions: TagOptions): void

Parameters

  • tagOptions TagOptions

Associate Tag Options.

A TagOption is a key-value pair managed in AWS Service Catalog. It is not an AWS tag, but serves as a template for creating an AWS tag based on the TagOption.


constrainCloudFormationParameters(product, options)

public constrainCloudFormationParameters(product: IProduct, options: CloudFormationRuleConstraintOptions): void

Parameters

  • product IProduct
  • options CloudFormationRuleConstraintOptions

Set provisioning rules for the product.


constrainTagUpdates(product, options?)

public constrainTagUpdates(product: IProduct, options?: TagUpdateConstraintOptions): void

Parameters

  • product IProduct
  • options TagUpdateConstraintOptions

Add a Resource Update Constraint.


deployWithStackSets(product, options)

public deployWithStackSets(product: IProduct, options: StackSetsConstraintOptions): void

Parameters

  • product IProduct
  • options StackSetsConstraintOptions

Configure deployment options using AWS Cloudformation StackSets.


giveAccessToGroup(group)

public giveAccessToGroup(group: IGroup): void

Parameters

  • group IGroup

Associate portfolio with an IAM Group.


giveAccessToRole(role)

public giveAccessToRole(role: IRole): void

Parameters

  • role IRole

Associate portfolio with an IAM Role.


giveAccessToUser(user)

public giveAccessToUser(user: IUser): void

Parameters

  • user IUser

Associate portfolio with an IAM User.


notifyOnStackEvents(product, topic, options?)

public notifyOnStackEvents(product: IProduct, topic: ITopic, options?: CommonConstraintOptions): void

Parameters

  • product IProduct
  • topic ITopic
  • options CommonConstraintOptions

Add notifications for supplied topics on the provisioned product.


setLaunchRole(product, launchRole, options?)

public setLaunchRole(product: IProduct, launchRole: IRole, options?: CommonConstraintOptions): void

Parameters

  • product IProduct
  • launchRole IRole
  • options CommonConstraintOptions

Force users to assume a certain role when launching a product.

This sets the launch role using the role arn which is tied to the account this role exists in. This is useful if you will be provisioning products from the account where this role exists. If you intend to share the portfolio across accounts, use a local launch role.


setLocalLaunchRole(product, launchRole, options?)

public setLocalLaunchRole(product: IProduct, launchRole: IRole, options?: CommonConstraintOptions): void

Parameters

  • product IProduct
  • launchRole IRole
  • options CommonConstraintOptions

Force users to assume a certain role when launching a product.

The role name will be referenced by in the local account and must be set explicitly. This is useful when sharing the portfolio with multiple accounts.


setLocalLaunchRoleName(product, launchRoleName, options?)

public setLocalLaunchRoleName(product: IProduct, launchRoleName: string, options?: CommonConstraintOptions): IRole

Parameters

  • product IProduct
  • launchRoleName string
  • options CommonConstraintOptions

Returns

  • IRole

Force users to assume a certain role when launching a product.

The role will be referenced by name in the local account instead of a static role arn. A role with this name will automatically be created and assumable by Service Catalog in this account. This is useful when sharing the portfolio with multiple accounts.


shareWithAccount(accountId, options?)

public shareWithAccount(accountId: string, options?: PortfolioShareOptions): void

Parameters

  • accountId string
  • options PortfolioShareOptions

Initiate a portfolio share with another account.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected addBucketPermissionsToSharedAccounts()

protected addBucketPermissionsToSharedAccounts(): void

Gives access to Asset Buckets to Shared Accounts.


protected generateUniqueHash(value)

protected generateUniqueHash(value: string): string

Parameters

  • value string

Returns

  • string

Create a unique id based off the L1 CfnPortfolio or the arn of an imported portfolio.


static fromPortfolioArn(scope, id, portfolioArn)

public static fromPortfolioArn(scope: Construct, id: string, portfolioArn: string): IPortfolio

Parameters

  • scope Construct — The parent creating construct (usually this).
  • id string — The construct's name.
  • portfolioArn string — the Amazon Resource Name of the existing portfolio.

Returns

  • IPortfolio

Creates a Portfolio construct that represents an external portfolio.