Skip to content

update_organization_configuration

update_organization_configuration(
    detector_id: DetectorId,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    auto_enable: Optional[Boolean] = None,
    data_sources: Optional[OrganizationDataSourceConfigurations] = None,
    features: Optional[OrganizationFeaturesConfigurations] = None,
    auto_enable_organization_members: Optional[AutoEnableMembers] = None,
) -> UpdateOrganizationConfigurationResponse

Configures the delegated administrator account with the provided values. You must provide a value for either autoEnableOrganizationMembers or autoEnable, but not both.

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 ID of the detector that configures the delegated administrator.

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

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

    Represents whether to automatically enable member accounts in the organization. This applies to only new member accounts, not the existing member accounts. When a new account joins the organization, the chosen features will be enabled for them by default.

    Even though this is still supported, we recommend using AutoEnableOrganizationMembers to achieve the similar results. You must provide a value for either autoEnableOrganizationMembers or autoEnable.

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

    Describes which data sources will be updated.

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

    A list of features that will be configured for the organization.

  • auto_enable_organization_members (Optional[AutoEnableMembers], default: None ) –

    Indicates the auto-enablement configuration of GuardDuty for the member accounts in the organization. You must provide a value for either autoEnableOrganizationMembers or autoEnable.

    Use one of the following configuration values for autoEnableOrganizationMembers:

    • NEW: Indicates that when a new account joins the organization, they will have GuardDuty enabled automatically.

    • ALL: Indicates that all accounts in the organization have GuardDuty enabled automatically. This includes NEW accounts that join the organization and accounts that may have been suspended or removed from the organization in GuardDuty.

      It may take up to 24 hours to update the configuration for all the member accounts.

    • NONE: Indicates that GuardDuty will not be automatically enabled for any account in the organization. The administrator must manage GuardDuty for each account in the organization individually.

      When you update the auto-enable setting from ALL or NEW to NONE, this action doesn't disable the corresponding option for your existing accounts. This configuration will apply to the new accounts that join the organization. After you update the auto-enable settings, no new account will have the corresponding option as enabled.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def update_organization_configuration(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    auto_enable: Optional["capo_guardduty.types.boolean.Boolean"] = None,
    data_sources: Optional[
        "capo_guardduty.types.organization_data_source_configurations.OrganizationDataSourceConfigurations"
    ] = None,
    features: Optional[
        "capo_guardduty.types.organization_features_configurations.OrganizationFeaturesConfigurations"
    ] = None,
    auto_enable_organization_members: Optional[
        "capo_guardduty.types.auto_enable_members.AutoEnableMembers"
    ] = None,
) -> "capo_guardduty.types.update_organization_configuration_response.UpdateOrganizationConfigurationResponse":
    """<p>Configures the delegated administrator account with the provided values. You must provide a value for either <code>autoEnableOrganizationMembers</code> or <code>autoEnable</code>, but not both. </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 ID of the detector that configures the delegated administrator.</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>
        auto_enable: <p>Represents whether to automatically enable member accounts in the organization. This applies to only new member accounts, not the existing member accounts. When a new account joins the organization, the chosen features will be enabled for them by default.</p> <p>Even though this is still supported, we recommend using <code>AutoEnableOrganizationMembers</code> to achieve the similar results. You must provide a value for either <code>autoEnableOrganizationMembers</code> or <code>autoEnable</code>.</p>
        data_sources: <p>Describes which data sources will be updated.</p>
        features: <p>A list of features that will be configured for the organization.</p>
        auto_enable_organization_members: <p>Indicates the auto-enablement configuration of GuardDuty for the member accounts in the organization. You must provide a value for either <code>autoEnableOrganizationMembers</code> or <code>autoEnable</code>. </p> <p>Use one of the following configuration values for <code>autoEnableOrganizationMembers</code>:</p> <ul> <li> <p> <code>NEW</code>: Indicates that when a new account joins the organization, they will have GuardDuty enabled automatically. </p> </li> <li> <p> <code>ALL</code>: Indicates that all accounts in the organization have GuardDuty enabled automatically. This includes <code>NEW</code> accounts that join the organization and accounts that may have been suspended or removed from the organization in GuardDuty.</p> <p>It may take up to 24 hours to update the configuration for all the member accounts.</p> </li> <li> <p> <code>NONE</code>: Indicates that GuardDuty will not be automatically enabled for any account in the organization. The administrator must manage GuardDuty for each account in the organization individually.</p> <p>When you update the auto-enable setting from <code>ALL</code> or <code>NEW</code> to <code>NONE</code>, this action doesn't disable the corresponding option for your existing accounts. This configuration will apply to the new accounts that join the organization. After you update the auto-enable settings, no new account will have the corresponding option as enabled.</p> </li> </ul>

    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.update_organization_configuration_request.UpdateOrganizationConfigurationRequest]",
    ) -> OperationResponse[
        "capo_guardduty.types.update_organization_configuration_response.UpdateOrganizationConfigurationResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.update_organization_configuration

        output, http_response = (
            capo_guardduty._operations.guard_duty_api_service.update_organization_configuration.update_organization_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateOrganizationConfiguration")
    )
    input_: capo_guardduty.types.update_organization_configuration_request.UpdateOrganizationConfigurationRequest = {
        "detector_id": detector_id
    }
    if auto_enable is not None:
        input_["auto_enable"] = auto_enable
    if data_sources is not None:
        input_["data_sources"] = data_sources
    if features is not None:
        input_["features"] = features
    if auto_enable_organization_members is not None:
        input_["auto_enable_organization_members"] = (
            auto_enable_organization_members
        )

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