update_rule
¶
update_rule(
rule_identifier: RuleIdentifier,
update_token: UpdateToken,
is_published: IsPublished,
*,
config_overrides: Optional[NetworkSecurityManagerClientConfig] = None,
rule_type: Optional[RuleType] = None,
rule_description: Optional[Description] = None,
configuration: Optional[JsonDocument] = None,
client_token: Optional[IdempotencyToken] = None,
) -> UpdateRuleOutput
Updates the specified rule. To prevent conflicting concurrent updates, provide the current updateToken. Use isPublished to publish the update or keep the rule as a draft.
Parameters:
-
rule_identifier(RuleIdentifier) –The identifier of the rule. This is the rule's Amazon Resource Name (ARN).
-
update_token(UpdateToken) –A token used for optimistic concurrency control. Each read and write returns an
updateToken. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications. -
rule_type(Optional[RuleType], default:None) –The type of the rule.
CONFIGURATIONrules contain firewall settings, andINSPECTIONrules contain rule groups. -
rule_description(Optional[Description], default:None) –A description of the rule.
-
configuration(Optional[JsonDocument], default:None) –The firewall configuration for the rule, as a JSON document. The structure depends on the rule's firewall type and rule type. For an AWS WAF
INSPECTIONrule, provide an AWS WAF rule group. For an AWS WAFCONFIGURATIONrule, provide a single web ACL setting, such asDefaultActionorVisibilityConfig; usewafConfigDataTypeto declare which setting the document contains. For the schema of each setting and complete examples, see Writing rule configurations in the AWS Network Security Manager Developer Guide. -
is_published(IsPublished) –Specifies whether to publish the resource. When
true, the resource is saved in published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT). -
client_token(Optional[IdempotencyToken], default:None) –A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action.
-
ConflictException–The request conflicts with the current state of the resource. For example, the resource was modified concurrently, or it is in a state that does not allow the requested operation.
-
InternalServerException–The request processing failed because of an internal error in the service. This is a retryable error.
-
ResourceNotFoundException–The specified resource was not found. Verify that the resource identifier is correct and that the resource exists, then try your request again.
-
ServiceQuotaExceededException–The request would exceed a service quota.
-
ThrottlingException–The request was denied because of request throttling. Reduce your request rate and try again.
-
ValidationException–The request failed validation. For details, see the
reasonandfieldListmembers of the response. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Update a rule and publish it Updates the rule's description and configuration and publishes the change. The updateToken from the most recent read is required for optimistic locking.
>>> client.update_rule(rule_identifier='arn:aws:network-security-manager:us-east-1:123456789012:rule:abc123', update_token='c1d2e3f4-4a5b-4c6d-9e7f-8a9b0c1d2e3f', rule_type='INSPECTION', rule_description='Blocks requests from known malicious IP addresses - updated list', configuration={}, is_published=True)
Source code in docs_src/capo_network_security_manager/_services/network_security_manager.py
2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 | |