update_rule
async
¶
update_rule(
rule_identifier: RuleIdentifier,
update_token: UpdateToken,
is_published: IsPublished,
*,
config_overrides: Optional[AsyncNetworkSecurityManagerClientConfig] = 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.
>>> await 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/async_network_security_manager.py
2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 | |