create_portfolio_share
async
¶
create_portfolio_share(
portfolio_id: Id,
*,
config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
accept_language: Optional[AcceptLanguage] = None,
account_id: Optional[AccountId] = None,
organization_node: Optional[OrganizationNode] = None,
share_tag_options: Optional[Boolean] = None,
share_principals: Optional[Boolean] = None,
) -> CreatePortfolioShareOutput
Shares the specified portfolio with the specified account or organization node. Shares to an organization node can only be created by the management account of an organization or by a delegated administrator. You can share portfolios to an organization, an organizational unit, or a specific account.
Note that if a delegated admin is de-registered, they can no longer create portfolio shares.
AWSOrganizationsAccess must be enabled in order to create a portfolio share to an organization node.
You can't share a shared resource, including portfolios that contain a shared product.
If the portfolio share with the specified account or organization node already exists, this action will have no effect and will not return an error. To update an existing share, you must use the UpdatePortfolioShare API instead.
When you associate a principal with portfolio, a potential privilege escalation path may occur when that portfolio is then shared with other accounts. For a user in a recipient account who is not an Service Catalog Admin, but still has the ability to create Principals (Users/Groups/Roles), that user could create a role that matches a principal name association for the portfolio. Although this user may not know which principal names are associated through Service Catalog, they may be able to guess the user. If this potential escalation path is a concern, then Service Catalog recommends using PrincipalType as IAM. With this configuration, the PrincipalARN must already exist in the recipient account before it can be associated.
Parameters:
-
accept_language(Optional[AcceptLanguage], default:None) –The language code.
-
jp- Japanese -
zh- Chinese
-
-
portfolio_id(Id) –The portfolio identifier.
-
account_id(Optional[AccountId], default:None) –The Amazon Web Services account ID. For example,
123456789012. -
organization_node(Optional[OrganizationNode], default:None) –The organization node to whom you are going to share. When you pass
OrganizationNode, it createsPortfolioSharefor all of the Amazon Web Services accounts that are associated to theOrganizationNode. The output returns aPortfolioShareToken, which enables the administrator to monitor the status of thePortfolioSharecreation process. -
share_tag_options(Optional[Boolean], default:None) –Enables or disables
TagOptionssharing when creating the portfolio share. If this flag is not provided, TagOptions sharing is disabled. -
share_principals(Optional[Boolean], default:None) –This parameter is only supported for portfolios with an OrganizationalNode Type of
ORGANIZATIONorORGANIZATIONAL_UNIT.Enables or disables
Principalsharing when creating the portfolio share. If you do not provide this flag, principal sharing is disabled.When you enable Principal Name Sharing for a portfolio share, the share recipient account end users with a principal that matches any of the associated IAM patterns can provision products from the portfolio. Once shared, the share recipient can view associations of
PrincipalType:IAM_PATTERNon their portfolio. You can create the principals in the recipient account before or after creating the share.
Raises:
-
InvalidParametersException–One or more parameters provided to the operation are not valid.
-
InvalidStateException–An attempt was made to modify a resource that is in a state that is not valid. Check your resources to ensure that they are in valid states before retrying the operation.
-
LimitExceededException–The current limits of the service would have been exceeded by this operation. Decrease your resource use or increase your service limits and retry the operation.
-
OperationNotSupportedException–The operation is not supported.
-
ResourceNotFoundException–The specified resource was not found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_service_catalog/_services/async_service_catalog.py
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 | |