Experimental
@aws-cdk/aws-route53resolver-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
FirewallRuleAction Class
A Firewall Rule.
| Stability | Experimental |
|---|---|
| Source | lib/firewall-rule-group.ts |
Example
ts
declare const myBlockList: route53resolver.FirewallDomainList;
new route53resolver.FirewallRuleGroup(this, 'RuleGroup', {
rules: [
{
priority: 10,
firewallDomainList: myBlockList,
// block and reply with NODATA
action: route53resolver.FirewallRuleAction.block(),
},
],
});
python
# my_block_list: route53resolver.FirewallDomainList
route53resolver.FirewallRuleGroup(self, "RuleGroup",
rules=[route53resolver.FirewallRule(
priority=10,
firewall_domain_list=my_block_list,
# block and reply with NODATA
action=route53resolver.FirewallRuleAction.block()
)
]
)
java
FirewallDomainList myBlockList;
FirewallRuleGroup.Builder.create(this, "RuleGroup")
.rules(List.of(FirewallRule.builder()
.priority(10)
.firewallDomainList(myBlockList)
// block and reply with NODATA
.action(FirewallRuleAction.block())
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Route53Resolver.Alpha
FirewallDomainList myBlockList;
new FirewallRuleGroup(this, "RuleGroup", new FirewallRuleGroupProps {
Rules = new [] { new FirewallRule {
Priority = 10,
FirewallDomainList = myBlockList,
// block and reply with NODATA
Action = FirewallRuleAction.Block()
} }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkroute53resolveralpha/v2
var myBlockList FirewallDomainList
route53resolver.NewFirewallRuleGroup(this, jsii.String("RuleGroup"), &FirewallRuleGroupProps{
Rules: []FirewallRule{
&FirewallRule{
Priority: jsii.Number(10),
FirewallDomainList: myBlockList,
// block and reply with NODATA
Action: route53resolver.FirewallRuleAction_Block(),
},
},
})
Initializer
ts
new FirewallRuleAction()
python
FirewallRuleAction()
java
new FirewallRuleAction()
csharp
new FirewallRuleAction()
go
NewFirewallRuleAction()
Properties
The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list.
blockResponsemay be undefinedDnsBlockResponseblock_responsemay be undefinedDnsBlockResponseblockResponsemay be undefinedDnsBlockResponseBlockResponsemay be undefinedDnsBlockResponseBlockResponsemay be undefinedDnsBlockResponse #The way that you want DNS Firewall to block the request.
Methods
alert(): FirewallRuleAction // chainable@staticmethod def alert() -> FirewallRuleActionpublic static FirewallRuleAction alert()public static FirewallRuleAction Alert()func Alert() FirewallRuleAction static #Permit the request to go through but send an alert to the logs.
allow(): FirewallRuleAction // chainable@staticmethod def allow() -> FirewallRuleActionpublic static FirewallRuleAction allow()public static FirewallRuleAction Allow()func Allow() FirewallRuleAction static #Permit the request to go through.
block(response?: DnsBlockResponse): FirewallRuleAction // chainable@staticmethod def block(response: typing.Optional[DnsBlockResponse] = None) -> FirewallRuleActionpublic static FirewallRuleAction block(DnsBlockResponse response)public static FirewallRuleAction Block(DnsBlockResponse? response = null)func Block(Response DnsBlockResponse) FirewallRuleAction static #Disallow the request.
1 parameter
Parameters
responseresponseresponseresponseResponse— The way that you want DNS Firewall to block the request.