NetworkSecurityManagerCustomerAPI / Client / update_rule

update_rule

NetworkSecurityManagerCustomerAPI.Client.update_rule(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.update_rule(
    ruleIdentifier='string',
    updateToken='string',
    ruleType='CONFIGURATION'|'INSPECTION',
    ruleDescription='string',
    configuration={...}|[...]|123|123.4|'string'|True|None,
    isPublished=True|False,
    clientToken='string'
)
Parameters:
  • ruleIdentifier (string) –

    [REQUIRED]

    The identifier of the rule. This is the rule’s Amazon Resource Name (ARN).

  • updateToken (string) –

    [REQUIRED]

    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.

  • ruleType (string) – The type of the rule. CONFIGURATION rules contain firewall settings, and INSPECTION rules contain rule groups.

  • ruleDescription (string) – A description of the rule.

  • configuration (document) – 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 INSPECTION rule, provide an AWS WAF rule group. For an AWS WAF CONFIGURATION rule, provide a single web ACL setting, such as DefaultAction or VisibilityConfig; use wafConfigDataType to 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.

  • isPublished (boolean) –

    [REQUIRED]

    Specifies whether to publish the resource. When true, the resource is saved in published ( ACTIVE) state. When false, it is saved as a draft ( DRAFT).

  • clientToken (string) –

    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.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'ruleId': 'string',
    'ruleArn': 'string',
    'ruleName': 'string',
    'firewallType': 'WAF',
    'ruleType': 'CONFIGURATION'|'INSPECTION',
    'ruleDescription': 'string',
    'configuration': {...}|[...]|123|123.4|'string'|True|None,
    'status': 'DRAFT'|'ACTIVE'|'DISABLED',
    'version': 'string',
    'updateToken': 'string',
    'isSnapshot': True|False,
    'hasPublishedVersion': True|False,
    'updatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    • ruleId (string) –

      The service-generated id of the rule.

    • ruleArn (string) –

      The Amazon Resource Name (ARN) of the rule.

    • ruleName (string) –

      The name of the rule.

    • firewallType (string) –

      The firewall type associated with the resource.

    • ruleType (string) –

      The type of the rule. CONFIGURATION rules contain firewall settings, and INSPECTION rules contain rule groups.

    • ruleDescription (string) –

      A description of the rule.

    • configuration (document) –

      The firewall configuration for the rule, as a JSON document. The structure depends on the rule’s firewall type and rule type.

    • status (string) –

      The current status of the resource: DRAFT (unpublished, editable) or ACTIVE (published, in use).

    • version (string) –

      The version of the resource.

    • updateToken (string) –

      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.

    • isSnapshot (boolean) –

      Specifies whether the resource is a snapshot of a published version.

    • hasPublishedVersion (boolean) –

      Specifies whether a published version of the resource exists.

    • updatedAt (datetime) –

      The time when the resource was last updated.

Exceptions