Skip to content

enable_organization_admin_account

enable_organization_admin_account(
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    admin_account_id: Optional[String] = None,
) -> EnableOrganizationAdminAccountResponse

Designates an Amazon Web Services account within the organization as your GuardDuty delegated administrator. Only the organization's management account can run this API operation.

Parameters:

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

    The Amazon Web Services account ID for the organization account to be enabled as a GuardDuty delegated administrator.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def enable_organization_admin_account(
    self,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    admin_account_id: Optional["capo_guardduty.types.string.String"] = None,
) -> "capo_guardduty.types.enable_organization_admin_account_response.EnableOrganizationAdminAccountResponse":
    """<p>Designates an Amazon Web Services account within the organization as your GuardDuty delegated administrator. Only the organization's management account can run this API operation.</p>

    Args:
        admin_account_id: <p>The Amazon Web Services account ID for the organization account to be enabled as a GuardDuty delegated administrator.</p>

    Raises:
        capo_guardduty.errors.bad_request_exception.BadRequestException: <p>A bad request exception object.</p>
        capo_guardduty.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error exception object.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_guardduty.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest]",
    ) -> OperationResponse[
        "capo_guardduty.types.enable_organization_admin_account_response.EnableOrganizationAdminAccountResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.enable_organization_admin_account

        output, http_response = (
            capo_guardduty._operations.guard_duty_api_service.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_guardduty.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest = {}
    if admin_account_id is not None:
        input_["admin_account_id"] = admin_account_id

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