interface DefaultActionProperty
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.WAFv2.CfnWebACL.DefaultActionProperty |
![]() | software.amazon.awscdk.services.wafv2.CfnWebACL.DefaultActionProperty |
![]() | aws_cdk.aws_wafv2.CfnWebACL.DefaultActionProperty |
![]() | @aws-cdk/aws-wafv2 » CfnWebACL » DefaultActionProperty |
In 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
.
The default action must be a terminating action.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as wafv2 from '@aws-cdk/aws-wafv2';
const defaultActionProperty: wafv2.CfnWebACL.DefaultActionProperty = {
allow: {
customRequestHandling: {
insertHeaders: [{
name: 'name',
value: 'value',
}],
},
},
block: {
customResponse: {
responseCode: 123,
// the properties below are optional
customResponseBodyKey: 'customResponseBodyKey',
responseHeaders: [{
name: 'name',
value: 'value',
}],
},
},
};
Properties
Name | Type | Description |
---|---|---|
allow? | IResolvable | Allow | Specifies that AWS WAF should allow requests by default. |
block? | IResolvable | Block | Specifies that AWS WAF should block requests by default. |
allow?
Type:
IResolvable
|
Allow
(optional)
Specifies that AWS WAF should allow requests by default.
block?
Type:
IResolvable
|
Block
(optional)
Specifies that AWS WAF should block requests by default.