WAFV2#
Client#
- class WAFV2.Client#
A low-level client representing AWS WAFV2
Note
This is the latest version of the WAF API, released in November, 2019. The names of the entities that you use to access this API, like endpoints and namespaces, all have the versioning information added, like “V2” or “v2”, to distinguish from the prior version. We recommend migrating your resources to this version, because it has a number of significant improvements.
If you used WAF prior to this release, you can’t use this WAFV2 API to access any WAF resources that you created before. You can access your old rules, web ACLs, and other WAF resources only through the WAF Classic APIs. The WAF Classic APIs have retained the prior names, endpoints, and namespaces.
For information, including how to migrate your WAF resources to this version, see the WAF Developer Guide.
WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to an Amazon CloudFront distribution, Amazon API Gateway REST API, Application Load Balancer, AppSync GraphQL API, Amazon Cognito user pool, or App Runner service. WAF also lets you control access to your content, to protect the Amazon Web Services resource that WAF is monitoring. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, the protected resource responds to requests with either the requested content, an HTTP 403 status code (Forbidden), or with a custom response.
This API guide is for developers who need detailed information about WAF API actions, data types, and errors. For detailed information about WAF features and guidance for configuring and using WAF, see the WAF Developer Guide.
You can make calls using the endpoints listed in WAF endpoints and quotas.
For regional applications, you can use any of the endpoints in the list. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, a Amazon Cognito user pool, or an App Runner service.
For Amazon CloudFront applications, you must use the API endpoint listed for US East (N. Virginia): us-east-1.
Alternatively, you can use one of the Amazon Web Services SDKs to access an API that’s tailored to the programming language or platform that you’re using. For more information, see Amazon Web Services SDKs.
We currently provide two versions of the WAF API: this API and the prior versions, the classic WAF APIs. This new API provides the same functionality as the older versions, with the following major improvements:
You use one API for both global and regional applications. Where you need to distinguish the scope, you specify a
Scope
parameter and set it toCLOUDFRONT
orREGIONAL
.You can define a web ACL or rule group with a single call, and update it with a single call. You define all rule specifications in JSON format, and pass them to your rule group or web ACL calls.
The limits WAF places on the use of rules more closely reflects the cost of running each type of rule. Rule groups include capacity settings, so you know the maximum cost of a rule group when you use it.
import boto3 client = boto3.client('wafv2')
These are the available methods:
- associate_web_acl
- can_paginate
- check_capacity
- close
- create_ip_set
- create_regex_pattern_set
- create_rule_group
- create_web_acl
- delete_firewall_manager_rule_groups
- delete_ip_set
- delete_logging_configuration
- delete_permission_policy
- delete_regex_pattern_set
- delete_rule_group
- delete_web_acl
- describe_managed_rule_group
- disassociate_web_acl
- generate_mobile_sdk_release_url
- get_ip_set
- get_logging_configuration
- get_managed_rule_set
- get_mobile_sdk_release
- get_paginator
- get_permission_policy
- get_rate_based_statement_managed_keys
- get_regex_pattern_set
- get_rule_group
- get_sampled_requests
- get_waiter
- get_web_acl
- get_web_acl_for_resource
- list_available_managed_rule_group_versions
- list_available_managed_rule_groups
- list_ip_sets
- list_logging_configurations
- list_managed_rule_sets
- list_mobile_sdk_releases
- list_regex_pattern_sets
- list_resources_for_web_acl
- list_rule_groups
- list_tags_for_resource
- list_web_acls
- put_logging_configuration
- put_managed_rule_set_versions
- put_permission_policy
- tag_resource
- untag_resource
- update_ip_set
- update_managed_rule_set_version_expiry_date
- update_regex_pattern_set
- update_rule_group
- update_web_acl