Skip to content

enable_organization_admin_account

enable_organization_admin_account(
    account_id: AccountId, *, config_overrides: Optional[DetectiveClientConfig] = None
) -> None

Designates the Detective administrator account for the organization in the current Region.

If the account does not have Detective enabled, then enables Detective for that account and creates a new behavior graph.

Can only be called by the organization management account.

If the organization has a delegated administrator account in Organizations, then the Detective administrator account must be either the delegated administrator account or the organization management account.

If the organization does not have a delegated administrator account in Organizations, then you can choose any account in the organization. If you choose an account other than the organization management account, Detective calls Organizations to make that account the delegated administrator account for Detective. The organization management account cannot be the delegated administrator account.

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account identifier of the account to designate as the Detective administrator account for the organization.

Raises:

Source code in docs_src/capo_detective/_services/detective.py
def enable_organization_admin_account(
    self,
    account_id: "capo_detective.types.account_id.AccountId",
    *,
    config_overrides: Optional[DetectiveClientConfig] = None,
) -> None:
    """<p>Designates the Detective administrator account for the organization in the current Region.</p> <p>If the account does not have Detective enabled, then enables Detective for that account and creates a new behavior graph.</p> <p>Can only be called by the organization management account.</p> <p>If the organization has a delegated administrator account in Organizations, then the Detective administrator account must be either the delegated administrator account or the organization management account.</p> <p>If the organization does not have a delegated administrator account in Organizations, then you can choose any account in the organization. If you choose an account other than the organization management account, Detective calls Organizations to make that account the delegated administrator account for Detective. The organization management account cannot be the delegated administrator account.</p>

    Args:
        account_id: <p>The Amazon Web Services account identifier of the account to designate as the Detective administrator account for the organization.</p>

    Raises:
        capo_detective.errors.access_denied_exception.AccessDeniedException: <p>The request issuer does not have permission to access this resource or perform this operation.</p>
        capo_detective.errors.internal_server_exception.InternalServerException: <p>The request was valid but failed because of a problem with the service.</p>
        capo_detective.errors.too_many_requests_exception.TooManyRequestsException: <p>The request cannot be completed because too many other requests are occurring at the same time.</p>
        capo_detective.errors.validation_exception.ValidationException: <p>The request parameters are invalid.</p>
        capo_detective.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_detective.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest]",
    ) -> OperationResponse[None]:
        import capo_detective._operations.amazon_detective.enable_organization_admin_account

        output, http_response = (
            capo_detective._operations.amazon_detective.enable_organization_admin_account.enable_organization_admin_account(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableOrganizationAdminAccount")
    )
    input_: capo_detective.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest = {
        "account_id": account_id
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output