Skip to content

update_detector async

update_detector(
    detector_id: DetectorId,
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    enable: Optional[Boolean] = None,
    finding_publishing_frequency: Optional[FindingPublishingFrequency] = None,
    data_sources: Optional[DataSourceConfigurations] = None,
    features: Optional[DetectorFeatureConfigurations] = None,
) -> UpdateDetectorResponse

Updates the GuardDuty detector specified by the detector ID.

Specifying both EKS Runtime Monitoring (EKS_RUNTIME_MONITORING) and Runtime Monitoring (RUNTIME_MONITORING) will cause an error. You can add only one of these two features because Runtime Monitoring already includes the threat detection for Amazon EKS resources. For more information, see Runtime Monitoring.

There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.

Parameters:

  • detector_id (DetectorId) –

    The unique ID of the detector to update.

    To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.

  • enable (Optional[Boolean], default: None ) –

    Specifies whether the detector is enabled or not enabled.

  • finding_publishing_frequency (Optional[FindingPublishingFrequency], default: None ) –

    An enum value that specifies how frequently findings are exported, such as to CloudWatch Events.

  • data_sources (Optional[DataSourceConfigurations], default: None ) –

    Describes which data sources will be updated.

    There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.

  • features (Optional[DetectorFeatureConfigurations], default: None ) –

    Provides the features that will be updated for the detector.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def update_detector(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    enable: Optional["capo_guardduty.types.boolean.Boolean"] = None,
    finding_publishing_frequency: Optional[
        "capo_guardduty.types.finding_publishing_frequency.FindingPublishingFrequency"
    ] = None,
    data_sources: Optional[
        "capo_guardduty.types.data_source_configurations.DataSourceConfigurations"
    ] = None,
    features: Optional[
        "capo_guardduty.types.detector_feature_configurations.DetectorFeatureConfigurations"
    ] = None,
) -> "capo_guardduty.types.update_detector_response.UpdateDetectorResponse":
    """<p>Updates the GuardDuty detector specified by the detector ID.</p> <p>Specifying both EKS Runtime Monitoring (<code>EKS_RUNTIME_MONITORING</code>) and Runtime Monitoring (<code>RUNTIME_MONITORING</code>) will cause an error. You can add only one of these two features because Runtime Monitoring already includes the threat detection for Amazon EKS resources. For more information, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/runtime-monitoring.html">Runtime Monitoring</a>.</p> <p>There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html">Regions and endpoints</a>.</p>

    Args:
        detector_id: <p>The unique ID of the detector to update.</p> <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
        enable: <p>Specifies whether the detector is enabled or not enabled.</p>
        finding_publishing_frequency: <p>An enum value that specifies how frequently findings are exported, such as to CloudWatch Events.</p>
        data_sources: <p>Describes which data sources will be updated.</p> <p>There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html">Regions and endpoints</a>.</p>
        features: <p>Provides the features that will be updated for the detector.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_guardduty.types.update_detector_request.UpdateDetectorRequest]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.update_detector_response.UpdateDetectorResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.update_detector

        (
            output,
            http_response,
        ) = await capo_guardduty._operations.guard_duty_api_service.update_detector.async_update_detector(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDetector")
    )
    input_: capo_guardduty.types.update_detector_request.UpdateDetectorRequest = {
        "detector_id": detector_id
    }
    if enable is not None:
        input_["enable"] = enable
    if finding_publishing_frequency is not None:
        input_["finding_publishing_frequency"] = finding_publishing_frequency
    if data_sources is not None:
        input_["data_sources"] = data_sources
    if features is not None:
        input_["features"] = features

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