Skip to content

update_malware_protection_plan

update_malware_protection_plan(
    malware_protection_plan_id: String,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    role: Optional[String] = None,
    actions: Optional[MalwareProtectionPlanActions] = None,
    protected_resource: Optional[UpdateProtectedResource] = None,
) -> None

Updates an existing Malware Protection plan resource.

Parameters:

  • malware_protection_plan_id (String) –

    A unique identifier associated with the Malware Protection plan.

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

    Amazon Resource Name (ARN) of the IAM role with permissions to scan and add tags to the associated protected resource.

  • actions (Optional[MalwareProtectionPlanActions], default: None ) –

    Information about whether the tags will be added to the S3 object after scanning.

  • protected_resource (Optional[UpdateProtectedResource], default: None ) –

    Information about the protected resource that is associated with the created Malware Protection plan. Presently, S3Bucket is the only supported protected resource.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def update_malware_protection_plan(
    self,
    malware_protection_plan_id: "capo_guardduty.types.string.String",
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    role: Optional["capo_guardduty.types.string.String"] = None,
    actions: Optional[
        "capo_guardduty.types.malware_protection_plan_actions.MalwareProtectionPlanActions"
    ] = None,
    protected_resource: Optional[
        "capo_guardduty.types.update_protected_resource.UpdateProtectedResource"
    ] = None,
) -> None:
    """<p>Updates an existing Malware Protection plan resource.</p>

    Args:
        malware_protection_plan_id: <p>A unique identifier associated with the Malware Protection plan.</p>
        role: <p>Amazon Resource Name (ARN) of the IAM role with permissions to scan and add tags to the associated protected resource.</p>
        actions: <p>Information about whether the tags will be added to the S3 object after scanning.</p>
        protected_resource: <p>Information about the protected resource that is associated with the created Malware Protection plan. Presently, <code>S3Bucket</code> is the only supported protected resource.</p>

    Raises:
        capo_guardduty.errors.access_denied_exception.AccessDeniedException: <p>An access denied exception object.</p>
        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.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_guardduty.types.update_malware_protection_plan_request.UpdateMalwareProtectionPlanRequest]",
    ) -> OperationResponse[None]:
        import capo_guardduty._operations.guard_duty_api_service.update_malware_protection_plan

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateMalwareProtectionPlan")
    )
    input_: capo_guardduty.types.update_malware_protection_plan_request.UpdateMalwareProtectionPlanRequest = {
        "malware_protection_plan_id": malware_protection_plan_id
    }
    if role is not None:
        input_["role"] = role
    if actions is not None:
        input_["actions"] = actions
    if protected_resource is not None:
        input_["protected_resource"] = protected_resource

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