DnsBlockResponse

class aws_cdk.aws_route53resolver.DnsBlockResponse

Bases: object

(experimental) The way that you want DNS Firewall to block the request.

Stability

experimental

ExampleMetadata

infused

Example:

# my_block_list: route53resolver.FirewallDomainList
# rule_group: route53resolver.FirewallRuleGroup


rule_group.add_rule(
    priority=10,
    firewall_domain_list=my_block_list,
    # block and reply with NXDOMAIN
    action=route53resolver.FirewallRuleAction.block(route53resolver.DnsBlockResponse.nx_domain())
)

rule_group.add_rule(
    priority=20,
    firewall_domain_list=my_block_list,
    # block and override DNS response with a custom domain
    action=route53resolver.FirewallRuleAction.block(route53resolver.DnsBlockResponse.override("amazon.com"))
)
Stability

experimental

Attributes

block_override_dns_type

(experimental) The DNS record’s type.

Stability

experimental

Return type

Optional[str]

block_override_domain

(experimental) The custom DNS record to send back in response to the query.

Stability

experimental

Return type

Optional[str]

block_override_ttl

(experimental) The recommended amount of time for the DNS resolver or web browser to cache the provided override record.

Stability

experimental

Return type

Optional[Duration]

block_response

(experimental) The way that you want DNS Firewall to block the request.

Stability

experimental

Return type

Optional[str]

Static Methods

classmethod no_data()

(experimental) Respond indicating that the query was successful, but no response is available for it.

Stability

experimental

Return type

DnsBlockResponse

classmethod nx_domain()

(experimental) Respond indicating that the domain name that’s in the query doesn’t exist.

Stability

experimental

Return type

DnsBlockResponse

classmethod override(domain, ttl=None)

(experimental) Provides a custom override response to the query.

Parameters
  • domain (str) – The custom DNS record to send back in response to the query.

  • ttl (Optional[Duration]) – The recommended amount of time for the DNS resolver or web browser to cache the provided override record.

Stability

experimental

Return type

DnsBlockResponse