Skip to content
v2.275.0

Portfolio L2 construct ​

A Service Catalog portfolio.

Example ​

ts
new servicecatalog.Portfolio(this, 'Portfolio', {
  displayName: 'MyPortfolio',
  providerName: 'MyTeam',
});
python
servicecatalog.Portfolio(self, "Portfolio",
    display_name="MyPortfolio",
    provider_name="MyTeam"
)
java
Portfolio.Builder.create(this, "Portfolio")
        .displayName("MyPortfolio")
        .providerName("MyTeam")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new Portfolio(this, "Portfolio", new PortfolioProps {
    DisplayName = "MyPortfolio",
    ProviderName = "MyTeam"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
servicecatalog.NewPortfolio(this, jsii.String("Portfolio"), &PortfolioProps{
	DisplayName: jsii.String("MyPortfolio"),
	ProviderName: jsii.String("MyTeam"),
})

Initializer ​

ts
new Portfolio(scope: Construct, id: string, props: PortfolioProps)
python
Portfolio(scope: Construct, id: str, props: PortfolioProps)
java
new Portfolio(Construct scope, String id, PortfolioProps props)
csharp
new Portfolio(Construct scope, string id, PortfolioProps props)
go
NewPortfolio(Scope Construct, Id *string, Props PortfolioProps)

Construct Props ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
Description for portfolio.

Default: No description provided

displayNamestringdisplay_namestrdisplayNameStringDisplayNamestringDisplayName*stringrequired#
The name of the portfolio.
messageLanguageoptionalMessageLanguagemessage_languageoptionalMessageLanguagemessageLanguageoptionalMessageLanguageMessageLanguageoptionalMessageLanguageMessageLanguageoptionalMessageLanguage= English#
The message language.

Controls language for status logging and errors.

providerNamestringprovider_namestrproviderNameStringProviderNamestringProviderName*stringrequired#
The provider name.
tagOptionsoptionalTagOptionstag_optionsoptionalTagOptionstagOptionsoptionalTagOptionsTagOptionsoptionalTagOptionsTagOptionsoptionalTagOptions#
TagOptions associated directly to a portfolio.

Default: No tagOptions provided

Properties ​

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

nodeNodenodeNodenodeNodeNodeNodeNodeNode#
The tree node.
portfolioArnstringportfolio_arnstrportfolioArnStringPortfolioArnstringPortfolioArn*string#
The ARN of the portfolio.
portfolioIdstringportfolio_idstrportfolioIdStringPortfolioIdstringPortfolioId*string#
The ID of the portfolio.
portfolioRefPortfolioReferenceportfolio_refPortfolioReferenceportfolioRefPortfolioReferencePortfolioRefPortfolioReferencePortfolioRefPortfolioReference#
A reference to a Portfolio resource.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStack#
The stack in which this resource is defined.

Methods ​

addProduct(product: IProduct): voiddef add_product(self, product: IProduct) -> Nonepublic void addProduct(IProduct product)public void AddProduct(IProduct product)func AddProduct(Product IProduct)#
Associate portfolio with the given product.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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: TagOptions): voiddef associate_tag_options(self, tag_options: TagOptions) -> Nonepublic void associateTagOptions(TagOptions tagOptions)public void AssociateTagOptions(TagOptions tagOptions)func AssociateTagOptions(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: IProduct, options: CloudFormationRuleConstraintOptions): voiddef constrain_cloud_formation_parameters(self, product: IProduct, options: CloudFormationRuleConstraintOptions) -> Nonepublic void constrainCloudFormationParameters(IProduct product, CloudFormationRuleConstraintOptions options)public void ConstrainCloudFormationParameters(IProduct product, CloudFormationRuleConstraintOptions options)func ConstrainCloudFormationParameters(Product IProduct, Options CloudFormationRuleConstraintOptions)#
Set provisioning rules for the product.
constrainTagUpdates(product: IProduct, options?: TagUpdateConstraintOptions): voiddef constrain_tag_updates(self, product: IProduct, options: typing.Optional[TagUpdateConstraintOptions] = None) -> Nonepublic void constrainTagUpdates(IProduct product, TagUpdateConstraintOptions options)public void ConstrainTagUpdates(IProduct product, TagUpdateConstraintOptions? options = null)func ConstrainTagUpdates(Product IProduct, Options TagUpdateConstraintOptions)#
Add a Resource Update Constraint.
deployWithStackSets(product: IProduct, options: StackSetsConstraintOptions): voiddef deploy_with_stack_sets(self, product: IProduct, options: StackSetsConstraintOptions) -> Nonepublic void deployWithStackSets(IProduct product, StackSetsConstraintOptions options)public void DeployWithStackSets(IProduct product, StackSetsConstraintOptions options)func DeployWithStackSets(Product IProduct, Options StackSetsConstraintOptions)#
Configure deployment options using AWS Cloudformation StackSets.
fromPortfolioArn(scope: Construct, id: string, portfolioArn: string): IPortfolio@staticmethod def from_portfolio_arn(scope: Construct, id: str, portfolio_arn: str) -> IPortfoliopublic static IPortfolio fromPortfolioArn(Construct scope, String id, String portfolioArn)public static IPortfolio FromPortfolioArn(Construct scope, string id, string portfolioArn)func FromPortfolioArn(Scope Construct, Id *string, PortfolioArn *string) IPortfoliostatic#
Creates a Portfolio construct that represents an external portfolio.
3 parameters

Parameters

  • scopescopescopescopeScope — The parent creating construct (usually this).
  • ididididId — The construct's name.
  • portfolioArnportfolio_arnportfolioArnportfolioArnPortfolioArn — the Amazon Resource Name of the existing portfolio.
giveAccessToGroup(group: IGroup): voiddef give_access_to_group(self, group: IGroup) -> Nonepublic void giveAccessToGroup(IGroup group)public void GiveAccessToGroup(IGroup group)func GiveAccessToGroup(Group IGroup)#
Associate portfolio with an IAM Group.
giveAccessToRole(role: IRole): voiddef give_access_to_role(self, role: IRole) -> Nonepublic void giveAccessToRole(IRole role)public void GiveAccessToRole(IRole role)func GiveAccessToRole(Role IRole)#
Associate portfolio with an IAM Role.
giveAccessToUser(user: IUser): voiddef give_access_to_user(self, user: IUser) -> Nonepublic void giveAccessToUser(IUser user)public void GiveAccessToUser(IUser user)func GiveAccessToUser(User IUser)#
Associate portfolio with an IAM User.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
notifyOnStackEvents(product: IProduct, topic: ITopic, options?: CommonConstraintOptions): voiddef notify_on_stack_events(self, product: IProduct, topic: ITopic, options: typing.Optional[CommonConstraintOptions] = None) -> Nonepublic void notifyOnStackEvents(IProduct product, ITopic topic, CommonConstraintOptions options)public void NotifyOnStackEvents(IProduct product, ITopic topic, CommonConstraintOptions? options = null)func NotifyOnStackEvents(Product IProduct, Topic ITopic, Options CommonConstraintOptions)#
Add notifications for supplied topics on the provisioned product.
setLaunchRole(product: IProduct, launchRole: IRole, options?: CommonConstraintOptions): voiddef set_launch_role(self, product: IProduct, launch_role: IRole, options: typing.Optional[CommonConstraintOptions] = None) -> Nonepublic void setLaunchRole(IProduct product, IRole launchRole, CommonConstraintOptions options)public void SetLaunchRole(IProduct product, IRole launchRole, CommonConstraintOptions? options = null)func SetLaunchRole(Product IProduct, LaunchRole IRole, Options CommonConstraintOptions)#
Force users to assume a certain role when launching a product.
notes

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: IProduct, launchRole: IRole, options?: CommonConstraintOptions): voiddef set_local_launch_role(self, product: IProduct, launch_role: IRole, options: typing.Optional[CommonConstraintOptions] = None) -> Nonepublic void setLocalLaunchRole(IProduct product, IRole launchRole, CommonConstraintOptions options)public void SetLocalLaunchRole(IProduct product, IRole launchRole, CommonConstraintOptions? options = null)func SetLocalLaunchRole(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: IProduct, launchRoleName: string, options?: CommonConstraintOptions): IRoledef set_local_launch_role_name(self, product: IProduct, launch_role_name: str, options: typing.Optional[CommonConstraintOptions] = None) -> IRolepublic IRole setLocalLaunchRoleName(IProduct product, String launchRoleName, CommonConstraintOptions options)public IRole SetLocalLaunchRoleName(IProduct product, string launchRoleName, CommonConstraintOptions? options = null)func SetLocalLaunchRoleName(Product IProduct, LaunchRoleName *string, Options CommonConstraintOptions) IRole#
Force users to assume a certain role when launching a product.
notes

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: string, options?: PortfolioShareOptions): voiddef share_with_account(self, account_id: str, options: typing.Optional[PortfolioShareOptions] = None) -> Nonepublic void shareWithAccount(String accountId, PortfolioShareOptions options)public void ShareWithAccount(string accountId, PortfolioShareOptions? options = null)func ShareWithAccount(AccountId *string, Options PortfolioShareOptions)#
Initiate a portfolio share with another account.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.