Class CfnWebACL
This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019.
Inherited Members
Namespace: Amazon.CDK.AWS.WAFv2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnWebACL : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnWebACL
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
For information, including how to migrate your AWS WAF resources from the prior release, see the AWS WAF developer guide .
Use an WebACL
to define a collection of rules to use to inspect and control web requests. Each rule in a web ACL has a statement that defines what to look for in web requests and an action that AWS WAF applies to requests that match the statement. In the web ACL, you assign a default action to take (allow, block) for any request that doesn't match any of the rules.
The rules in a web ACL can be a combination of explicitly defined rules and rule groups that you reference from the web ACL. The rule groups can be rule groups that you manage or rule groups that are managed by others.
You can associate a web ACL with one or more AWS resources to protect. The resources can be an Amazon CloudFront distribution, an Amazon API Gateway REST API, an Application Load Balancer , an AWS AppSync GraphQL API , an Amazon Cognito user pool, an AWS App Runner service, or an AWS Verified Access instance.
For more information, see Web access control lists (web ACLs) in the AWS WAF developer guide .
Web ACLs used in AWS Shield Advanced automatic application layer DDoS mitigation
If you use Shield Advanced automatic application layer DDoS mitigation, the web ACLs that you use with automatic mitigation have a rule group rule whose name starts with ShieldMitigationRuleGroup
. This rule is used for automatic mitigations and it's managed for you in the web ACL by Shield Advanced and AWS WAF . You'll see the rule listed among the web ACL rules when you view the web ACL through the AWS WAF interfaces.
When you manage the web ACL through AWS CloudFormation interfaces, you won't see the Shield Advanced rule. AWS CloudFormation doesn't include this type of rule in the stack drift status between the actual configuration of the web ACL and your web ACL template.
Don't add the Shield Advanced rule group rule to your web ACL template. The rule shouldn't be in your template. When you update the web ACL template in a stack, the Shield Advanced rule is maintained for you by AWS WAF in the resulting web ACL.
For more information, see Shield Advanced automatic application layer DDoS mitigation in the AWS Shield Advanced developer guide .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-webacl.html
CloudformationResource: AWS::WAFv2::WebACL
ExampleMetadata: fixture=_generated
Synopsis
Constructors
CfnWebACL(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnWebACL(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnWebACL(Construct, String, ICfnWebACLProps) |
Properties
AssociationConfig | Specifies custom configurations for the associations between the web ACL and protected resources. |
AttrArn | The Amazon Resource Name (ARN) of the web ACL. |
AttrCapacity | The web ACL capacity units (WCUs) currently being used by this web ACL. |
AttrId | The ID of the web ACL. |
AttrLabelNamespace | The label namespace prefix for this web ACL. |
CaptchaConfig | Specifies how AWS WAF should handle |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ChallengeConfig | Specifies how AWS WAF should handle challenge evaluations for rules that don't have their own |
CustomResponseBodies | A map of custom response keys and content bodies. |
DefaultAction | The action to perform if none of the |
Description | A description of the web ACL that helps with identification. |
Name | The name of the web ACL. |
Rules | The rule statements used to identify the web requests that you want to manage. |
Scope | Specifies whether this is for an Amazon CloudFront distribution or for a regional application. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | Key:value pairs associated with an AWS resource. |
TokenDomains | Specifies the domains that AWS WAF should accept in a web request token. |
VisibilityConfig | Defines and enables Amazon CloudWatch metrics and web request sample collection. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnWebACL(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnWebACL(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnWebACL(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnWebACL(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnWebACL(Construct, String, ICfnWebACLProps)
public CfnWebACL(Construct scope, string id, ICfnWebACLProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnWebACLProps
Resource properties.
Properties
AssociationConfig
Specifies custom configurations for the associations between the web ACL and protected resources.
public virtual object AssociationConfig { get; set; }
Property Value
System.Object
AttrArn
The Amazon Resource Name (ARN) of the web ACL.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
AttrCapacity
The web ACL capacity units (WCUs) currently being used by this web ACL.
public virtual double AttrCapacity { get; }
Property Value
System.Double
Remarks
AWS WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.
CloudformationAttribute: Capacity
AttrId
The ID of the web ACL.
public virtual string AttrId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Id
AttrLabelNamespace
The label namespace prefix for this web ACL.
public virtual string AttrLabelNamespace { get; }
Property Value
System.String
Remarks
All labels added by rules in this web ACL have this prefix.
The syntax for the label namespace prefix for a web ACL is the following: awswaf:<account ID>:webacl:<web ACL name>:
When a rule with a label matches a web request, AWS WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon.
CloudformationAttribute: LabelNamespace
CaptchaConfig
Specifies how AWS WAF should handle CAPTCHA
evaluations for rules that don't have their own CaptchaConfig
settings.
public virtual object CaptchaConfig { get; set; }
Property Value
System.Object
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ChallengeConfig
Specifies how AWS WAF should handle challenge evaluations for rules that don't have their own ChallengeConfig
settings.
public virtual object ChallengeConfig { get; set; }
Property Value
System.Object
CustomResponseBodies
A map of custom response keys and content bodies.
public virtual object CustomResponseBodies { get; set; }
Property Value
System.Object
DefaultAction
The action to perform if none of the Rules
contained in the WebACL
match.
public virtual object DefaultAction { get; set; }
Property Value
System.Object
Description
A description of the web ACL that helps with identification.
public virtual string Description { get; set; }
Property Value
System.String
Name
The name of the web ACL.
public virtual string Name { get; set; }
Property Value
System.String
Rules
The rule statements used to identify the web requests that you want to manage.
public virtual object Rules { get; set; }
Property Value
System.Object
Scope
Specifies whether this is for an Amazon CloudFront distribution or for a regional application.
public virtual string Scope { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
Key:value pairs associated with an AWS resource.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
TokenDomains
Specifies the domains that AWS WAF should accept in a web request token.
public virtual string[] TokenDomains { get; set; }
Property Value
System.String[]
VisibilityConfig
Defines and enables Amazon CloudWatch metrics and web request sample collection.
public virtual object VisibilityConfig { get; set; }
Property Value
System.Object
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>