Skip to content
v2.275.0

AWS::WAFv2 Construct Library ​

This module is part of the AWS Cloud Development Kit project.

ts
import * as wafv2 from 'aws-cdk-lib/aws-wafv2';
python
import aws_cdk.aws_wafv2 as wafv2
java
import software.amazon.awscdk.services.wafv2.*;
csharp
using Amazon.CDK.AWS.WAFv2;
go
import wafv2 "github.com/aws/aws-cdk-go/awscdk"

There are no official hand-written (L2) constructs for this service yet. Here are some suggestions on how to proceed:

There are no hand-written (L2) constructs for this service yet. However, you can still use the automatically generated L1 constructs, and use this service exactly as you would using CloudFormation directly.

For more information on the resources and properties available for this service, see the CloudFormation documentation for AWS::WAFv2.

(Read the CDK Contributing Guide and submit an RFC if you are interested in contributing to this construct library.)

Types ​

NameKindSummary
CfnIPSetConstruct (L1)> This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019.
CfnLoggingConfigurationConstruct (L1)Defines an association between logging destinations and a web ACL resource, for logging from AWS WAF .
CfnRegexPatternSetConstruct (L1)> This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019.
CfnRuleGroupConstruct (L1)> This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019.
CfnWebACLConstruct (L1)> This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019.
CfnWebACLAssociationConstruct (L1)> This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019.
CfnIPSetPropsStructProperties for defining a CfnIPSet.
CfnLoggingConfiguration.ActionConditionPropertyStructA single action condition for a condition in a logging filter.
CfnLoggingConfiguration.ConditionPropertyStructA single match condition for a log filter.
CfnLoggingConfiguration.FieldToMatchPropertyStructThe parts of the request that you want to keep out of the logs.
CfnLoggingConfiguration.FilterPropertyStructA single logging filter, used in LoggingFilter .
CfnLoggingConfiguration.JsonBodyPropertyStruct
CfnLoggingConfiguration.LabelNameConditionPropertyStructA single label name condition for a condition in a logging filter.
CfnLoggingConfiguration.LoggingFilterPropertyStructFiltering that specifies which web requests are kept in the logs and which are dropped, defined for a web ACL's LoggingConfiguration .
CfnLoggingConfiguration.MatchPatternPropertyStruct
CfnLoggingConfiguration.SingleHeaderPropertyStructInspect one of the headers in the web request, identified by name, for example, User-Agent or Referer .
CfnLoggingConfigurationPropsStructProperties for defining a CfnLoggingConfiguration.
CfnRegexPatternSetPropsStructProperties for defining a CfnRegexPatternSet.
CfnRuleGroup.AllowPropertyStructAllow traffic towards application.
CfnRuleGroup.AndStatementPropertyStructA logical rule statement used to combine other rule statements with AND logic.
CfnRuleGroup.AsnMatchStatementPropertyStructA rule statement that inspects web traffic based on the Autonomous System Number (ASN) associated with the request's IP address.
CfnRuleGroup.BlockPropertyStructBlock traffic towards application.
CfnRuleGroup.BodyPropertyStructInspect the body of the web request. The body immediately follows the request headers.
CfnRuleGroup.ByteMatchStatementPropertyStructA rule statement that defines a string match search for AWS WAF to apply to web requests.
CfnRuleGroup.CaptchaConfigPropertyStructSpecifies how AWS WAF should handle CAPTCHA evaluations.
CfnRuleGroup.CaptchaPropertyStructChecks valid token exists with request.
CfnRuleGroup.ChallengeConfigPropertyStructSpecifies how AWS WAF should handle Challenge evaluations.
CfnRuleGroup.ChallengePropertyStructChecks that the request has a valid token with an unexpired challenge timestamp and, if not, returns a browser challenge to the client.
CfnRuleGroup.CookieMatchPatternPropertyStructThe filter to use to identify the subset of cookies to inspect in a web request.
CfnRuleGroup.CookiesPropertyStructInspect the cookies in the web request.
CfnRuleGroup.CountPropertyStructCount traffic towards application.
CfnRuleGroup.CryptoConfigPropertyStructConfigures cryptocurrency payment settings.
CfnRuleGroup.CustomHTTPHeaderPropertyStructA custom header for custom request and response handling.
CfnRuleGroup.CustomRequestHandlingPropertyStructCustom request handling behavior that inserts custom headers into a web request.
CfnRuleGroup.CustomResponseBodyPropertyStructThe response body to use in a custom response to a web request.
CfnRuleGroup.CustomResponsePropertyStructA custom response to send to the client.
CfnRuleGroup.FieldToMatchPropertyStructSpecifies a web request component to be used in a rule match statement or in a logging configuration.
CfnRuleGroup.ForwardedIPConfigurationPropertyStructThe configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin.
CfnRuleGroup.GeoMatchStatementPropertyStructA rule statement that labels web requests by country and region and that matches against web requests based on country code.
CfnRuleGroup.HeaderMatchPatternPropertyStructThe filter to use to identify the subset of headers to inspect in a web request.
CfnRuleGroup.HeaderOrderPropertyStructThe string containing the list of a web request's header names, ordered as they appear in the web request, separated by colons.
CfnRuleGroup.HeadersPropertyStructInspect all headers in the web request.
CfnRuleGroup.ImmunityTimePropertyPropertyStructUsed for CAPTCHA and challenge token settings.
CfnRuleGroup.IPSetForwardedIPConfigurationPropertyStructThe configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin.
CfnRuleGroup.IPSetReferenceStatementPropertyStructA rule statement used to detect web requests coming from particular IP addresses or address ranges.
CfnRuleGroup.JA3FingerprintPropertyStructAvailable for use with Amazon CloudFront distributions and Application Load Balancers.
CfnRuleGroup.JA4FingerprintPropertyStructAvailable for use with Amazon CloudFront distributions and Application Load Balancers.
CfnRuleGroup.JsonBodyPropertyStructInspect the body of the web request as JSON. The body immediately follows the request headers.
CfnRuleGroup.JsonMatchPatternPropertyStructThe patterns to look for in the JSON body.
CfnRuleGroup.LabelMatchStatementPropertyStructA rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL.
CfnRuleGroup.LabelPropertyStructA single label container.
CfnRuleGroup.LabelSummaryPropertyStructList of labels used by one or more of the rules of a RuleGroup .
CfnRuleGroup.MonetizationConfigPropertyStructConfigures monetization for the web ACL or rule group.
CfnRuleGroup.MonetizeActionPropertyStructMonetize action for rules.
CfnRuleGroup.NotStatementPropertyStructA logical rule statement used to negate the results of another rule statement.
CfnRuleGroup.OrStatementPropertyStructA logical rule statement used to combine other rule statements with OR logic.
CfnRuleGroup.PaymentNetworkPropertyStructConfiguration for a single payment network.
CfnRuleGroup.PreParseTextTransformationPropertyStructText Transformation applied before parsing the query string.
CfnRuleGroup.PricePropertyStructA price configuration.
CfnRuleGroup.RateBasedStatementCustomKeyPropertyStructSpecifies a single custom aggregate key for a rate-base rule.
CfnRuleGroup.RateBasedStatementPropertyStructA rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate.
CfnRuleGroup.RateLimitCookiePropertyStructSpecifies a cookie as an aggregate key for a rate-based rule.
CfnRuleGroup.RateLimitHeaderPropertyStructSpecifies a header as an aggregate key for a rate-based rule.
CfnRuleGroup.RateLimitJA3FingerprintPropertyStructUse the request's JA3 fingerprint derived from the TLS Client Hello of an incoming request as an aggregate key.
CfnRuleGroup.RateLimitJA4FingerprintPropertyStructUse the request's JA4 fingerprint derived from the TLS Client Hello of an incoming request as an aggregate key.
CfnRuleGroup.RateLimitLabelNamespacePropertyStructSpecifies a label namespace to use as an aggregate key for a rate-based rule.
CfnRuleGroup.RateLimitQueryArgumentPropertyStructSpecifies a query argument in the request as an aggregate key for a rate-based rule.
CfnRuleGroup.RateLimitQueryStringPropertyStructSpecifies the request's query string as an aggregate key for a rate-based rule.
CfnRuleGroup.RateLimitUriPathPropertyStructSpecifies the request's URI path as an aggregate key for a rate-based rule.
CfnRuleGroup.RegexMatchStatementPropertyStructA rule statement used to search web request components for a match against a single regular expression.
CfnRuleGroup.RegexPatternSetReferenceStatementPropertyStructA rule statement used to search web request components for matches with regular expressions.
CfnRuleGroup.RuleActionPropertyStructThe action that AWS WAF should take on a web request when it matches a rule's statement.
CfnRuleGroup.RulePropertyStructA single rule, which you can use in a WebACL or RuleGroup to identify web requests that you want to manage in some way.
CfnRuleGroup.SingleHeaderPropertyStructInspect one of the headers in the web request, identified by name, for example, User-Agent or Referer .
CfnRuleGroup.SingleQueryArgumentPropertyStructInspect one query argument in the web request, identified by name, for example UserName or SalesRegion .
CfnRuleGroup.SizeConstraintStatementPropertyStructA rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<).
CfnRuleGroup.SqliMatchStatementPropertyStructA rule statement that inspects for malicious SQL code.
CfnRuleGroup.StatementPropertyStructThe processing guidance for a rule, used by AWS WAF to determine whether a web request matches the rule.
CfnRuleGroup.TextTransformationPropertyStructText transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.
CfnRuleGroup.UriFragmentPropertyStructInspect fragments of the request URI.
CfnRuleGroup.VisibilityConfigPropertyStructDefines and enables Amazon CloudWatch metrics and web request sample collection.
CfnRuleGroup.XssMatchStatementPropertyStructA rule statement that inspects for cross-site scripting (XSS) attacks.
CfnRuleGroupPropsStructProperties for defining a CfnRuleGroup.
CfnWebACL.AllowActionPropertyStructSpecifies that AWS WAF should allow the request and optionally defines additional custom handling for the request.
CfnWebACL.AndStatementPropertyStructA logical rule statement used to combine other rule statements with AND logic.
CfnWebACL.ApplicationAttributePropertyStructApplication details defined during the web ACL creation process.
CfnWebACL.ApplicationConfigPropertyStructA list of ApplicationAttribute s that contains information about the application.
CfnWebACL.AsnMatchStatementPropertyStructA rule statement that inspects web traffic based on the Autonomous System Number (ASN) associated with the request's IP address.
CfnWebACL.AssociationConfigPropertyStructSpecifies custom configurations for the associations between the web ACL and protected resources.
CfnWebACL.AWSManagedRulesACFPRuleSetPropertyStructDetails for your use of the account creation fraud prevention managed rule group, AWSManagedRulesACFPRuleSet .
CfnWebACL.AWSManagedRulesAntiDDoSRuleSetPropertyStructConfigures the use of the anti-DDoS managed rule group, AWSManagedRulesAntiDDoSRuleSet . This configuration is used in ManagedRuleGroupConfig .
CfnWebACL.AWSManagedRulesATPRuleSetPropertyStructDetails for your use of the account takeover prevention managed rule group, AWSManagedRulesATPRuleSet .
CfnWebACL.AWSManagedRulesBotControlRuleSetPropertyStructDetails for your use of the Bot Control managed rule group, AWSManagedRulesBotControlRuleSet .
CfnWebACL.BlockActionPropertyStructSpecifies that AWS WAF should block the request and optionally defines additional custom handling for the response to the web request.
CfnWebACL.BodyPropertyStructInspect the body of the web request. The body immediately follows the request headers.
CfnWebACL.ByteMatchStatementPropertyStructA rule statement that defines a string match search for AWS WAF to apply to web requests.
CfnWebACL.CaptchaActionPropertyStructSpecifies that AWS WAF should run a CAPTCHA check against the request:.
CfnWebACL.CaptchaConfigPropertyStructSpecifies how AWS WAF should handle CAPTCHA evaluations for rules that don't have their own CaptchaConfig settings.
CfnWebACL.ChallengeActionPropertyStructSpecifies that AWS WAF should run a Challenge check against the request to verify that the request is coming from a legitimate client session: - If the request includes a valid, unexpired challenge token, AWS WAF applies any custom request handling and labels that you've configured and then allows the web request inspection to proceed to the next rule, similar to a CountAction .
CfnWebACL.ChallengeConfigPropertyStructSpecifies how AWS WAF should handle Challenge evaluations.
CfnWebACL.ClientSideActionConfigPropertyStructThis is part of the configuration for the managed rules AWSManagedRulesAntiDDoSRuleSet in ManagedRuleGroupConfig .
CfnWebACL.ClientSideActionPropertyStructThis is part of the AWSManagedRulesAntiDDoSRuleSet ClientSideActionConfig configuration in ManagedRuleGroupConfig .
CfnWebACL.CookieMatchPatternPropertyStructThe filter to use to identify the subset of cookies to inspect in a web request.
CfnWebACL.CookiesPropertyStructInspect the cookies in the web request.
CfnWebACL.CountActionPropertyStructSpecifies that AWS WAF should count the request. Optionally defines additional custom handling for the request.
CfnWebACL.CryptoConfigPropertyStructConfigures cryptocurrency payment settings.
CfnWebACL.CustomHTTPHeaderPropertyStructA custom header for custom request and response handling.
CfnWebACL.CustomRequestHandlingPropertyStructCustom request handling behavior that inserts custom headers into a web request.
CfnWebACL.CustomResponseBodyPropertyStructThe response body to use in a custom response to a web request.
CfnWebACL.CustomResponsePropertyStructA custom response to send to the client.
CfnWebACL.DataProtectionConfigPropertyStructSpecifies data protection to apply to the web request data for the web ACL.
CfnWebACL.DataProtectPropertyStruct
CfnWebACL.DefaultActionPropertyStructIn a WebACL , this is the action that you want AWS WAF to perform when a web request doesn't match any of the rules in the WebACL .
CfnWebACL.ExcludedRulePropertyStructSpecifies a single rule in a rule group whose action you want to override to Count .
CfnWebACL.FieldIdentifierPropertyStructThe identifier of a field in the web request payload that contains customer data.
CfnWebACL.FieldToMatchPropertyStructSpecifies a web request component to be used in a rule match statement or in a logging configuration.
CfnWebACL.FieldToProtectPropertyStructSpecifies a field type and keys to protect in stored web request data.
CfnWebACL.ForwardedIPConfigurationPropertyStructThe configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin.
CfnWebACL.GeoMatchStatementPropertyStructA rule statement that labels web requests by country and region and that matches against web requests based on country code.
CfnWebACL.HeaderMatchPatternPropertyStructThe filter to use to identify the subset of headers to inspect in a web request.
CfnWebACL.HeaderOrderPropertyStructThe string containing the list of a web request's header names, ordered as they appear in the web request, separated by colons.
CfnWebACL.HeadersPropertyStructInspect all headers in the web request.
CfnWebACL.ImmunityTimePropertyPropertyStructUsed for CAPTCHA and challenge token settings.
CfnWebACL.IPSetForwardedIPConfigurationPropertyStructThe configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin.
CfnWebACL.IPSetReferenceStatementPropertyStructA rule statement used to detect web requests coming from particular IP addresses or address ranges.
CfnWebACL.JA3FingerprintPropertyStructAvailable for use with Amazon CloudFront distributions and Application Load Balancers.
CfnWebACL.JA4FingerprintPropertyStructAvailable for use with Amazon CloudFront distributions and Application Load Balancers.
CfnWebACL.JsonBodyPropertyStructInspect the body of the web request as JSON. The body immediately follows the request headers.
CfnWebACL.JsonMatchPatternPropertyStructThe patterns to look for in the JSON body.
CfnWebACL.LabelMatchStatementPropertyStructA rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL.
CfnWebACL.LabelPropertyStructA single label container.
CfnWebACL.ManagedRuleGroupConfigPropertyStructAdditional information that's used by a managed rule group. Many managed rule groups don't require this.
CfnWebACL.ManagedRuleGroupStatementPropertyStructA rule statement used to run the rules that are defined in a managed rule group.
CfnWebACL.MonetizationConfigPropertyStructConfigures monetization for the web ACL or rule group.
CfnWebACL.MonetizeActionPropertyStructMonetize action for rules.
CfnWebACL.NotStatementPropertyStructA logical rule statement used to negate the results of another rule statement.
CfnWebACL.OnSourceDDoSProtectionConfigPropertyStructConfigures the level of DDoS protection that applies to web ACLs associated with Application Load Balancers.
CfnWebACL.OrStatementPropertyStructA logical rule statement used to combine other rule statements with OR logic.
CfnWebACL.OverrideActionPropertyStructThe action to use in the place of the action that results from the rule group evaluation.
CfnWebACL.PaymentNetworkPropertyStructConfiguration for a single payment network.
CfnWebACL.PreParseTextTransformationPropertyStructText Transformation applied before parsing the query string.
CfnWebACL.PricePropertyStructA price configuration.
CfnWebACL.RateBasedStatementCustomKeyPropertyStructSpecifies a single custom aggregate key for a rate-base rule.
CfnWebACL.RateBasedStatementPropertyStructA rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate.
CfnWebACL.RateLimitCookiePropertyStructSpecifies a cookie as an aggregate key for a rate-based rule.
CfnWebACL.RateLimitHeaderPropertyStructSpecifies a header as an aggregate key for a rate-based rule.
CfnWebACL.RateLimitJA3FingerprintPropertyStructUse the request's JA3 fingerprint derived from the TLS Client Hello of an incoming request as an aggregate key.
CfnWebACL.RateLimitJA4FingerprintPropertyStructUse the request's JA4 fingerprint derived from the TLS Client Hello of an incoming request as an aggregate key.
CfnWebACL.RateLimitLabelNamespacePropertyStructSpecifies a label namespace to use as an aggregate key for a rate-based rule.
CfnWebACL.RateLimitQueryArgumentPropertyStructSpecifies a query argument in the request as an aggregate key for a rate-based rule.
CfnWebACL.RateLimitQueryStringPropertyStructSpecifies the request's query string as an aggregate key for a rate-based rule.
CfnWebACL.RateLimitUriPathPropertyStructSpecifies the request's URI path as an aggregate key for a rate-based rule.
CfnWebACL.RegexMatchStatementPropertyStructA rule statement used to search web request components for a match against a single regular expression.
CfnWebACL.RegexPatternSetReferenceStatementPropertyStructA rule statement used to search web request components for matches with regular expressions.
CfnWebACL.RegexPropertyStructA single regular expression.
CfnWebACL.RequestBodyAssociatedResourceTypeConfigPropertyStructCustomizes the maximum size of the request body that your protected CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access resources forward to AWS WAF for inspection.
CfnWebACL.RequestInspectionACFPPropertyStructThe criteria for inspecting account creation requests, used by the ACFP rule group to validate and track account creation attempts.
CfnWebACL.RequestInspectionPropertyStructThe criteria for inspecting login requests, used by the ATP rule group to validate credentials usage.
CfnWebACL.ResponseInspectionBodyContainsPropertyStructConfigures inspection of the response body.
CfnWebACL.ResponseInspectionHeaderPropertyStructConfigures inspection of the response header. This is part of the ResponseInspection configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet .
CfnWebACL.ResponseInspectionJsonPropertyStructConfigures inspection of the response JSON.
CfnWebACL.ResponseInspectionPropertyStructThe criteria for inspecting responses to login requests and account creation requests, used by the ATP and ACFP rule groups to track login and account creation success and failure rates.
CfnWebACL.ResponseInspectionStatusCodePropertyStructConfigures inspection of the response status code. This is part of the ResponseInspection configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet .
CfnWebACL.RuleActionOverridePropertyStructAction setting to use in the place of a rule action that is configured inside the rule group.
CfnWebACL.RuleActionPropertyStructThe action that AWS WAF should take on a web request when it matches a rule's statement.
CfnWebACL.RuleGroupReferenceStatementPropertyStructA rule statement used to run the rules that are defined in a RuleGroup .
CfnWebACL.RulePropertyStructA single rule, which you can use in a WebACL or RuleGroup to identify web requests that you want to manage in some way.
CfnWebACL.SingleHeaderPropertyStructInspect one of the headers in the web request, identified by name, for example, User-Agent or Referer .
CfnWebACL.SingleQueryArgumentPropertyStructInspect one query argument in the web request, identified by name, for example UserName or SalesRegion .
CfnWebACL.SizeConstraintStatementPropertyStructA rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<).
CfnWebACL.SqliMatchStatementPropertyStructA rule statement that inspects for malicious SQL code.
CfnWebACL.StatementPropertyStructThe processing guidance for a rule, used by AWS WAF to determine whether a web request matches the rule.
CfnWebACL.TextTransformationPropertyStructText transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.
CfnWebACL.UriFragmentPropertyStructInspect fragments of the request URI.
CfnWebACL.VisibilityConfigPropertyStructDefines and enables Amazon CloudWatch metrics and web request sample collection.
CfnWebACL.XssMatchStatementPropertyStructA rule statement that inspects for cross-site scripting (XSS) attacks.
CfnWebACLAssociationPropsStructProperties for defining a CfnWebACLAssociation.
CfnWebACLPropsStructProperties for defining a CfnWebACL.