Skip to content

disable_organization_admin_account async

disable_organization_admin_account(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    admin_account_id: Optional[NonEmptyString] = None,
    feature: Optional[SecurityHubFeature] = None,
) -> DisableOrganizationAdminAccountResponse

Disables a Security Hub CSPM administrator account. Can only be called by the organization management account.

Parameters:

  • admin_account_id (Optional[NonEmptyString], default: None ) –

    The Amazon Web Services account identifier of the Security Hub CSPM administrator account.

  • feature (Optional[SecurityHubFeature], default: None ) –

    The feature for which the delegated admin account is disabled. Defaults to Security Hub CSPM if not specified.

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action specified in the request.

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To remove a Security Hub administrator account The following example removes the Security Hub administrator account in the Region from which the operation was executed. This operation doesn't remove the delegated administrator account in AWS Organizations.

>>> await client.disable_organization_admin_account(admin_account_id='123456789012')
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def disable_organization_admin_account(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    admin_account_id: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
    feature: Optional[
        "capo_securityhub.types.security_hub_feature.SecurityHubFeature"
    ] = None,
) -> "capo_securityhub.types.disable_organization_admin_account_response.DisableOrganizationAdminAccountResponse":
    """<p>Disables a Security Hub CSPM administrator account. Can only be called by the organization management account.</p>

    Args:
        admin_account_id: <p>The Amazon Web Services account identifier of the Security Hub CSPM administrator account.</p>
        feature: <p>The feature for which the delegated admin account is disabled. Defaults to Security Hub CSPM if not specified.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To remove a Security Hub administrator account
        The following example removes the Security Hub administrator account in the Region from which the operation was executed. This operation doesn't remove the delegated administrator account in AWS Organizations.

        >>> await client.disable_organization_admin_account(admin_account_id='123456789012')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.disable_organization_admin_account_request.DisableOrganizationAdminAccountRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.disable_organization_admin_account_response.DisableOrganizationAdminAccountResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.disable_organization_admin_account

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.disable_organization_admin_account.async_disable_organization_admin_account(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisableOrganizationAdminAccount")
    )
    input_: capo_securityhub.types.disable_organization_admin_account_request.DisableOrganizationAdminAccountRequest = {}
    if admin_account_id is not None:
        input_["admin_account_id"] = admin_account_id
    if feature is not None:
        input_["feature"] = feature

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output