Portfolio L2 construct
A Service Catalog portfolio.
Example
new servicecatalog.Portfolio(this, 'Portfolio', {
displayName: 'MyPortfolio',
providerName: 'MyTeam',
});
servicecatalog.Portfolio(self, "Portfolio",
display_name="MyPortfolio",
provider_name="MyTeam"
)
Portfolio.Builder.create(this, "Portfolio")
.displayName("MyPortfolio")
.providerName("MyTeam")
.build();
// Install: dotnet add package Amazon.CDK.Lib
new Portfolio(this, "Portfolio", new PortfolioProps {
DisplayName = "MyPortfolio",
ProviderName = "MyTeam"
});
// 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
new Portfolio(scope: Construct, id: string, props: PortfolioProps)
Portfolio(scope: Construct, id: str, props: PortfolioProps)
new Portfolio(Construct scope, String id, PortfolioProps props)
new Portfolio(Construct scope, string id, PortfolioProps props)
NewPortfolio(Scope Construct, Id *string, Props PortfolioProps)
Construct Props
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#Default: No description provided
messageLanguageoptionalMessageLanguagemessage_languageoptionalMessageLanguagemessageLanguageoptionalMessageLanguageMessageLanguageoptionalMessageLanguageMessageLanguageoptionalMessageLanguage= English#Controls language for status logging and errors.
tagOptionsoptionalTagOptionstag_optionsoptionalTagOptionstagOptionsoptionalTagOptionsTagOptionsoptionalTagOptionsTagOptionsoptionalTagOptions#Default: No tagOptions provided
Properties
envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironment#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.
portfolioRefPortfolioReferenceportfolio_refPortfolioReferenceportfolioRefPortfolioReferencePortfolioRefPortfolioReferencePortfolioRefPortfolioReference#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringstatic#Methods
addProduct(product: IProduct): voiddef add_product(self, product: IProduct) -> Nonepublic void addProduct(IProduct product)public void AddProduct(IProduct product)func AddProduct(Product IProduct)#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)#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)#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)#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)#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)#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)#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#3 parameters
Parameters
scopescopescopescopeScope— The parent creating construct (usuallythis).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)#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)#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)#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#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#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#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)#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)#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)#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#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.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.