class Portfolio (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Servicecatalog.Portfolio |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsservicecatalog#Portfolio |
Java | software.amazon.awscdk.services.servicecatalog.Portfolio |
Python | aws_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
Portfolio
Props
Construct Props
Name | Type | Description |
---|---|---|
display | string | The name of the portfolio. |
provider | string | The provider name. |
description? | string | Description for portfolio. |
message | Message | The message language. |
tag | Tag | TagOptions 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:
Message
(optional, default: English)
The message language.
Controls language for status logging and errors.
tagOptions?
Type:
Tag
(optional, default: No tagOptions provided)
TagOptions associated directly to a portfolio.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
portfolio | string | The ARN of the portfolio. |
portfolio | string | The ID of the portfolio. |
stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
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
Name | Description |
---|---|
add | Associate portfolio with the given product. |
apply | Apply the given removal policy to this resource. |
associate | Associate Tag Options. |
constrain | Set provisioning rules for the product. |
constrain | Add a Resource Update Constraint. |
deploy | Configure deployment options using AWS Cloudformation StackSets. |
give | Associate portfolio with an IAM Group. |
give | Associate portfolio with an IAM Role. |
give | Associate portfolio with an IAM User. |
notify | Add notifications for supplied topics on the provisioned product. |
set | Force users to assume a certain role when launching a product. |
set | Force users to assume a certain role when launching a product. |
set | Force users to assume a certain role when launching a product. |
share | Initiate a portfolio share with another account. |
to | Returns a string representation of this construct. |
protected add | Gives access to Asset Buckets to Shared Accounts. |
protected generate | Create a unique id based off the L1 CfnPortfolio or the arn of an imported portfolio. |
static from | Creates a Portfolio construct that represents an external portfolio. |
Product(product)
addpublic addProduct(product: IProduct): void
Parameters
- product
IProduct
Associate portfolio with the given product.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
TagOptions(tagOptions)
associatepublic associateTagOptions(tagOptions: TagOptions): void
Parameters
- tagOptions
Tag
Options
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.
CloudFormationParameters(product, options)
constrainpublic constrainCloudFormationParameters(product: IProduct, options: CloudFormationRuleConstraintOptions): void
Parameters
- product
IProduct
- options
Cloud
Formation Rule Constraint Options
Set provisioning rules for the product.
TagUpdates(product, options?)
constrainpublic constrainTagUpdates(product: IProduct, options?: TagUpdateConstraintOptions): void
Parameters
- product
IProduct
- options
Tag
Update Constraint Options
Add a Resource Update Constraint.
WithStackSets(product, options)
deploypublic deployWithStackSets(product: IProduct, options: StackSetsConstraintOptions): void
Parameters
- product
IProduct
- options
Stack
Sets Constraint Options
Configure deployment options using AWS Cloudformation StackSets.
AccessToGroup(group)
givepublic giveAccessToGroup(group: IGroup): void
Parameters
- group
IGroup
Associate portfolio with an IAM Group.
AccessToRole(role)
givepublic giveAccessToRole(role: IRole): void
Parameters
- role
IRole
Associate portfolio with an IAM Role.
AccessToUser(user)
givepublic giveAccessToUser(user: IUser): void
Parameters
- user
IUser
Associate portfolio with an IAM User.
OnStackEvents(product, topic, options?)
notifypublic notifyOnStackEvents(product: IProduct, topic: ITopic, options?: CommonConstraintOptions): void
Parameters
- product
IProduct
- topic
ITopic
- options
Common
Constraint Options
Add notifications for supplied topics on the provisioned product.
LaunchRole(product, launchRole, options?)
setpublic setLaunchRole(product: IProduct, launchRole: IRole, options?: CommonConstraintOptions): void
Parameters
- product
IProduct
- launchRole
IRole
- options
Common
Constraint Options
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.
LocalLaunchRole(product, launchRole, options?)
setpublic setLocalLaunchRole(product: IProduct, launchRole: IRole, options?: CommonConstraintOptions): void
Parameters
- product
IProduct
- launchRole
IRole
- options
Common
Constraint Options
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.
LocalLaunchRoleName(product, launchRoleName, options?)
setpublic setLocalLaunchRoleName(product: IProduct, launchRoleName: string, options?: CommonConstraintOptions): IRole
Parameters
- product
IProduct
- launchRoleName
string
- options
Common
Constraint Options
Returns
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.
WithAccount(accountId, options?)
sharepublic shareWithAccount(accountId: string, options?: PortfolioShareOptions): void
Parameters
- accountId
string
- options
Portfolio
Share Options
Initiate a portfolio share with another account.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
BucketPermissionsToSharedAccounts()
protected addprotected addBucketPermissionsToSharedAccounts(): void
Gives access to Asset Buckets to Shared Accounts.
UniqueHash(value)
protected generateprotected 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.
PortfolioArn(scope, id, portfolioArn)
static frompublic static fromPortfolioArn(scope: Construct, id: string, portfolioArn: string): IPortfolio
Parameters
- scope
Construct
— The parent creating construct (usuallythis
). - id
string
— The construct's name. - portfolioArn
string
— the Amazon Resource Name of the existing portfolio.
Returns
Creates a Portfolio construct that represents an external portfolio.