update_regex_pattern_set

update_regex_pattern_set(**kwargs)

Note

This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.

For the latest version of AWS WAF , use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

Inserts or deletes RegexPatternString objects in a RegexPatternSet. For each RegexPatternString object, you specify the following values:

  • Whether to insert or delete the RegexPatternString .
  • The regular expression pattern that you want to insert or delete. For more information, see RegexPatternSet.

For example, you can create a RegexPatternString such as B[a@]dB[o0]t . AWS WAF will match this RegexPatternString to:

To create and configure a RegexPatternSet , perform the following steps:

  • Create a RegexPatternSet. For more information, see CreateRegexPatternSet.
  • Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateRegexPatternSet request.
  • Submit an UpdateRegexPatternSet request to specify the regular expression pattern that you want AWS WAF to watch for.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide.

See also: AWS API Documentation

Request Syntax

response = client.update_regex_pattern_set(
    RegexPatternSetId='string',
    Updates=[
        {
            'Action': 'INSERT'|'DELETE',
            'RegexPatternString': 'string'
        },
    ],
    ChangeToken='string'
)
Parameters
  • RegexPatternSetId (string) --

    [REQUIRED]

    The RegexPatternSetId of the RegexPatternSet that you want to update. RegexPatternSetId is returned by CreateRegexPatternSet and by ListRegexPatternSets.

  • Updates (list) --

    [REQUIRED]

    An array of RegexPatternSetUpdate objects that you want to insert into or delete from a RegexPatternSet.

    • (dict) --

      Note

      This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.

      For the latest version of AWS WAF , use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

      In an UpdateRegexPatternSet request, RegexPatternSetUpdate specifies whether to insert or delete a RegexPatternString and includes the settings for the RegexPatternString .

      • Action (string) -- [REQUIRED]

        Specifies whether to insert or delete a RegexPatternString .

      • RegexPatternString (string) -- [REQUIRED]

        Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as B[a@]dB[o0]t .

  • ChangeToken (string) --

    [REQUIRED]

    The value returned by the most recent call to GetChangeToken.

Return type

dict

Returns

Response Syntax

{
    'ChangeToken': 'string'
}

Response Structure

  • (dict) --

    • ChangeToken (string) --

      The ChangeToken that you used to submit the UpdateRegexPatternSet request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.

Exceptions

  • WAFRegional.Client.exceptions.WAFStaleDataException
  • WAFRegional.Client.exceptions.WAFInternalErrorException
  • WAFRegional.Client.exceptions.WAFLimitsExceededException
  • WAFRegional.Client.exceptions.WAFNonexistentItemException
  • WAFRegional.Client.exceptions.WAFNonexistentContainerException
  • WAFRegional.Client.exceptions.WAFInvalidOperationException
  • WAFRegional.Client.exceptions.WAFInvalidAccountException
  • WAFRegional.Client.exceptions.WAFInvalidRegexPatternException