Disassociates a previously associated principal ARN from a specified portfolio.
The PrincipalType and PrincipalARN must match the AssociatePrincipalWithPortfolio call request details. For example, to disassociate an association created with a PrincipalARN of PrincipalType IAM you must use the PrincipalType IAM when calling DisassociatePrincipalFromPortfolio.
For portfolios that have been shared with principal name sharing enabled: after disassociating a principal, share recipient accounts will no longer be able to provision products in this portfolio using a role matching the name of the associated principal.
For more information, review associate-principal-with-portfolio in the Amazon Web Services CLI Command Reference.
If you disassociate a principal from a portfolio, with PrincipalType as IAM, the same principal will still have access to the portfolio if it matches one of the associated principals of type IAM_PATTERN. To fully remove access for a principal, verify all the associated Principals of type IAM_PATTERN, and then ensure you disassociate any IAM_PATTERN principals that match the principal whose access you are removing.
Parameters:
-
accept_language
(Optional[AcceptLanguage], default:
None
)
–
The language code.
-
jp - Japanese
-
zh - Chinese
-
portfolio_id
(Id)
–
The portfolio identifier.
-
principal_arn
(PrincipalARN)
–
The ARN of the principal (user, role, or group). This field allows an ARN with no accountID with or without wildcard characters if PrincipalType is IAM_PATTERN.
-
principal_type
(Optional[PrincipalType], default:
None
)
–
The supported value is IAM if you use a fully defined ARN, or IAM_PATTERN if you specify an IAM ARN with no AccountId, with or without wildcard characters.
Raises:
Source code in docs_src/capo_service_catalog/_services/service_catalog.py
| def disassociate_principal_from_portfolio(
self,
portfolio_id: "capo_service_catalog.types.id.Id",
principal_arn: "capo_service_catalog.types.principal_arn.PrincipalARN",
*,
config_overrides: Optional[ServiceCatalogClientConfig] = None,
accept_language: Optional[
"capo_service_catalog.types.accept_language.AcceptLanguage"
] = None,
principal_type: Optional[
"capo_service_catalog.types.principal_type.PrincipalType"
] = None,
) -> "capo_service_catalog.types.disassociate_principal_from_portfolio_output.DisassociatePrincipalFromPortfolioOutput":
"""<p>Disassociates a previously associated principal ARN from a specified portfolio.</p> <p>The <code>PrincipalType</code> and <code>PrincipalARN</code> must match the <code>AssociatePrincipalWithPortfolio</code> call request details. For example, to disassociate an association created with a <code>PrincipalARN</code> of <code>PrincipalType</code> IAM you must use the <code>PrincipalType</code> IAM when calling <code>DisassociatePrincipalFromPortfolio</code>. </p> <p>For portfolios that have been shared with principal name sharing enabled: after disassociating a principal, share recipient accounts will no longer be able to provision products in this portfolio using a role matching the name of the associated principal. </p> <p>For more information, review <a href="https://docs.aws.amazon.com/cli/latest/reference/servicecatalog/associate-principal-with-portfolio.html#options">associate-principal-with-portfolio</a> in the Amazon Web Services CLI Command Reference. </p> <note> <p>If you disassociate a principal from a portfolio, with PrincipalType as <code>IAM</code>, the same principal will still have access to the portfolio if it matches one of the associated principals of type <code>IAM_PATTERN</code>. To fully remove access for a principal, verify all the associated Principals of type <code>IAM_PATTERN</code>, and then ensure you disassociate any <code>IAM_PATTERN</code> principals that match the principal whose access you are removing.</p> </note>
Args:
accept_language: <p>The language code.</p> <ul> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>
portfolio_id: <p>The portfolio identifier.</p>
principal_arn: <p>The ARN of the principal (user, role, or group). This field allows an ARN with no <code>accountID</code> with or without wildcard characters if <code>PrincipalType</code> is <code>IAM_PATTERN</code>.</p>
principal_type: <p>The supported value is <code>IAM</code> if you use a fully defined ARN, or <code>IAM_PATTERN</code> if you specify an <code>IAM</code> ARN with no AccountId, with or without wildcard characters. </p>
Raises:
capo_service_catalog.errors.invalid_parameters_exception.InvalidParametersException: <p>One or more parameters provided to the operation are not valid.</p>
capo_service_catalog.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_service_catalog.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_service_catalog.types.disassociate_principal_from_portfolio_input.DisassociatePrincipalFromPortfolioInput]",
) -> OperationResponse[
"capo_service_catalog.types.disassociate_principal_from_portfolio_output.DisassociatePrincipalFromPortfolioOutput"
]:
import capo_service_catalog._operations.aws242_service_catalog_service.disassociate_principal_from_portfolio
output, http_response = (
capo_service_catalog._operations.aws242_service_catalog_service.disassociate_principal_from_portfolio.disassociate_principal_from_portfolio(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DisassociatePrincipalFromPortfolio")
)
input_: capo_service_catalog.types.disassociate_principal_from_portfolio_input.DisassociatePrincipalFromPortfolioInput = {
"portfolio_id": portfolio_id,
"principal_arn": principal_arn,
}
if accept_language is not None:
input_["accept_language"] = accept_language
if principal_type is not None:
input_["principal_type"] = principal_type
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|