Skip to content

Client

wafv2 R Documentation

AWS WAFV2

Description

WAF

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, App Runner service, or Amazon Web Services Verified Access instance. 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, an Amazon Cognito user pool, an App Runner service, or an Amazon Web Services Verified Access instance.

  • 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 to CLOUDFRONT or REGIONAL.

  • 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.

Usage

wafv2(config = list(), credentials = list(), endpoint = NULL, region = NULL)

Arguments

config

Optional configuration of credentials, endpoint, and/or region.

  • credentials:

    • creds:

      • access_key_id: AWS access key ID

      • secret_access_key: AWS secret access key

      • session_token: AWS temporary session token

    • profile: The name of a profile to use. If not given, then the default profile is used.

    • anonymous: Set anonymous credentials.

  • endpoint: The complete URL to use for the constructed client.

  • region: The AWS Region used in instantiating the client.

  • close_connection: Immediately close all HTTP connections.

  • timeout: The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.

  • s3_force_path_style: Set this to true to force the request to use path-style addressing, i.e. ⁠http://s3.amazonaws.com/BUCKET/KEY⁠.

  • sts_regional_endpoint: Set sts regional endpoint resolver to regional or legacy https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html

credentials

Optional credentials shorthand for the config parameter

  • creds:

    • access_key_id: AWS access key ID

    • secret_access_key: AWS secret access key

    • session_token: AWS temporary session token

  • profile: The name of a profile to use. If not given, then the default profile is used.

  • anonymous: Set anonymous credentials.

endpoint

Optional shorthand for complete URL to use for the constructed client.

region

Optional shorthand for AWS Region used in instantiating the client.

Value

A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.

Service syntax

svc <- wafv2(
  config = list(
    credentials = list(
      creds = list(
        access_key_id = "string",
        secret_access_key = "string",
        session_token = "string"
      ),
      profile = "string",
      anonymous = "logical"
    ),
    endpoint = "string",
    region = "string",
    close_connection = "logical",
    timeout = "numeric",
    s3_force_path_style = "logical",
    sts_regional_endpoint = "string"
  ),
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string",
    anonymous = "logical"
  ),
  endpoint = "string",
  region = "string"
)

Operations

associate_web_acl
Associates a web ACL with a regional application resource, to protect the resource
check_capacity
Returns the web ACL capacity unit (WCU) requirements for a specified scope and set of rules
create_api_key
Creates an API key that contains a set of token domains
create_ip_set
Creates an IPSet, which you use to identify web requests that originate from specific IP addresses or ranges of IP addresses
create_regex_pattern_set
Creates a RegexPatternSet, which you reference in a RegexPatternSetReferenceStatement, to have WAF inspect a web request component for the specified patterns
create_rule_group
Creates a RuleGroup per the specifications provided
create_web_acl
Creates a WebACL per the specifications provided
delete_firewall_manager_rule_groups
Deletes all rule groups that are managed by Firewall Manager for the specified web ACL
delete_ip_set
Deletes the specified IPSet
delete_logging_configuration
Deletes the LoggingConfiguration from the specified web ACL
delete_permission_policy
Permanently deletes an IAM policy from the specified rule group
delete_regex_pattern_set
Deletes the specified RegexPatternSet
delete_rule_group
Deletes the specified RuleGroup
delete_web_acl
Deletes the specified WebACL
describe_all_managed_products
Provides high-level information for the Amazon Web Services Managed Rules rule groups and Amazon Web Services Marketplace managed rule groups
describe_managed_products_by_vendor
Provides high-level information for the managed rule groups owned by a specific vendor
describe_managed_rule_group
Provides high-level information for a managed rule group, including descriptions of the rules
disassociate_web_acl
Disassociates the specified regional application resource from any existing web ACL association
generate_mobile_sdk_release_url
Generates a presigned download URL for the specified release of the mobile SDK
get_decrypted_api_key
Returns your API key in decrypted form
get_ip_set
Retrieves the specified IPSet
get_logging_configuration
Returns the LoggingConfiguration for the specified web ACL
get_managed_rule_set
Retrieves the specified managed rule set
get_mobile_sdk_release
Retrieves information for the specified mobile SDK release, including release notes and tags
get_permission_policy
Returns the IAM policy that is attached to the specified rule group
get_rate_based_statement_managed_keys
Retrieves the IP addresses that are currently blocked by a rate-based rule instance
get_regex_pattern_set
Retrieves the specified RegexPatternSet
get_rule_group
Retrieves the specified RuleGroup
get_sampled_requests
Gets detailed information about a specified number of requests--a sample--that WAF randomly selects from among the first 5,000 requests that your Amazon Web Services resource received during a time range that you choose
get_web_acl
Retrieves the specified WebACL
get_web_acl_for_resource
Retrieves the WebACL for the specified resource
list_api_keys
Retrieves a list of the API keys that you've defined for the specified scope
list_available_managed_rule_groups
Retrieves an array of managed rule groups that are available for you to use
list_available_managed_rule_group_versions
Returns a list of the available versions for the specified managed rule group
list_ip_sets
Retrieves an array of IPSetSummary objects for the IP sets that you manage
list_logging_configurations
Retrieves an array of your LoggingConfiguration objects
list_managed_rule_sets
Retrieves the managed rule sets that you own
list_mobile_sdk_releases
Retrieves a list of the available releases for the mobile SDK and the specified device platform
list_regex_pattern_sets
Retrieves an array of RegexPatternSetSummary objects for the regex pattern sets that you manage
list_resources_for_web_acl
Retrieves an array of the Amazon Resource Names (ARNs) for the regional resources that are associated with the specified web ACL
list_rule_groups
Retrieves an array of RuleGroupSummary objects for the rule groups that you manage
list_tags_for_resource
Retrieves the TagInfoForResource for the specified resource
list_web_ac_ls
Retrieves an array of WebACLSummary objects for the web ACLs that you manage
put_logging_configuration
Enables the specified LoggingConfiguration, to start logging from a web ACL, according to the configuration provided
put_managed_rule_set_versions
Defines the versions of your managed rule set that you are offering to the customers
put_permission_policy
Attaches an IAM policy to the specified resource
tag_resource
Associates tags with the specified Amazon Web Services resource
untag_resource
Disassociates tags from an Amazon Web Services resource
update_ip_set
Updates the specified IPSet
update_managed_rule_set_version_expiry_date
Updates the expiration information for your managed rule set
update_regex_pattern_set
Updates the specified RegexPatternSet
update_rule_group
Updates the specified RuleGroup
update_web_acl
Updates the specified WebACL

Examples

## Not run: 
svc <- wafv2()
svc$associate_web_acl(
  Foo = 123
)

## End(Not run)