ResolverFirewallRule class

Provides a Route 53 Resolver DNS Firewall rule resource.

Example Usage

Domain List Rule

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.route53.ResolverFirewallDomainList("example", {
    name: "example",
    domains: ["example.com"],
    tags: {},
});
const exampleResolverFirewallRuleGroup = new aws.route53.ResolverFirewallRuleGroup("example", {
    name: "example",
    tags: {},
});
const exampleResolverFirewallRule = new aws.route53.ResolverFirewallRule("example", {
    name: "example",
    action: "BLOCK",
    blockOverrideDnsType: "CNAME",
    blockOverrideDomain: "example.com",
    blockOverrideTtl: 1,
    blockResponse: "OVERRIDE",
    firewallDomainListId: example.id,
    firewallRuleGroupId: exampleResolverFirewallRuleGroup.id,
    priority: 100,
});
import pulumi
import pulumi_aws as aws

example = aws.route53.ResolverFirewallDomainList("example",
    name="example",
    domains=["example.com"],
    tags={})
example_resolver_firewall_rule_group = aws.route53.ResolverFirewallRuleGroup("example",
    name="example",
    tags={})
example_resolver_firewall_rule = aws.route53.ResolverFirewallRule("example",
    name="example",
    action="BLOCK",
    block_override_dns_type="CNAME",
    block_override_domain="example.com",
    block_override_ttl=1,
    block_response="OVERRIDE",
    firewall_domain_list_id=example.id,
    firewall_rule_group_id=example_resolver_firewall_rule_group.id,
    priority=100)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Route53.ResolverFirewallDomainList("example", new()
    {
        Name = "example",
        Domains = new[]
        {
            "example.com",
        },
        Tags = null,
    });

    var exampleResolverFirewallRuleGroup = new Aws.Route53.ResolverFirewallRuleGroup("example", new()
    {
        Name = "example",
        Tags = null,
    });

    var exampleResolverFirewallRule = new Aws.Route53.ResolverFirewallRule("example", new()
    {
        Name = "example",
        Action = "BLOCK",
        BlockOverrideDnsType = "CNAME",
        BlockOverrideDomain = "example.com",
        BlockOverrideTtl = 1,
        BlockResponse = "OVERRIDE",
        FirewallDomainListId = example.Id,
        FirewallRuleGroupId = exampleResolverFirewallRuleGroup.Id,
        Priority = 100,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/route53"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := route53.NewResolverFirewallDomainList(ctx, "example", &route53.ResolverFirewallDomainListArgs{
			Name: pulumi.String("example"),
			Domains: pulumi.StringArray{
				pulumi.String("example.com"),
			},
			Tags: pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		exampleResolverFirewallRuleGroup, err := route53.NewResolverFirewallRuleGroup(ctx, "example", &route53.ResolverFirewallRuleGroupArgs{
			Name: pulumi.String("example"),
			Tags: pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		_, err = route53.NewResolverFirewallRule(ctx, "example", &route53.ResolverFirewallRuleArgs{
			Name:                 pulumi.String("example"),
			Action:               pulumi.String("BLOCK"),
			BlockOverrideDnsType: pulumi.String("CNAME"),
			BlockOverrideDomain:  pulumi.String("example.com"),
			BlockOverrideTtl:     pulumi.Int(1),
			BlockResponse:        pulumi.String("OVERRIDE"),
			FirewallDomainListId: example.ID().ToIDOutput().ToStringOutput(),
			FirewallRuleGroupId:  exampleResolverFirewallRuleGroup.ID().ToIDOutput().ToStringOutput(),
			Priority:             pulumi.Int(100),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_route53_resolverfirewalldomainlist" "example" {
  name    = "example"
  domains = ["example.com"]
  tags    = {}
}
resource "aws_route53_resolverfirewallrulegroup" "example" {
  name = "example"
  tags = {}
}
resource "aws_route53_resolverfirewallrule" "example" {
  name                    = "example"
  action                  = "BLOCK"
  block_override_dns_type = "CNAME"
  block_override_domain   = "example.com"
  block_override_ttl      = 1
  block_response          = "OVERRIDE"
  firewall_domain_list_id = aws_route53_resolverfirewalldomainlist.example.id
  firewall_rule_group_id  = aws_route53_resolverfirewallrulegroup.example.id
  priority                = 100
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.ResolverFirewallDomainList;
import com.pulumi.aws.route53.ResolverFirewallDomainListArgs;
import com.pulumi.aws.route53.ResolverFirewallRuleGroup;
import com.pulumi.aws.route53.ResolverFirewallRuleGroupArgs;
import com.pulumi.aws.route53.ResolverFirewallRule;
import com.pulumi.aws.route53.ResolverFirewallRuleArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ResolverFirewallDomainList("example", ResolverFirewallDomainListArgs.builder()
            .name("example")
            .domains("example.com")
            .tags(Map.ofEntries(
            ))
            .build());

        var exampleResolverFirewallRuleGroup = new ResolverFirewallRuleGroup("exampleResolverFirewallRuleGroup", ResolverFirewallRuleGroupArgs.builder()
            .name("example")
            .tags(Map.ofEntries(
            ))
            .build());

        var exampleResolverFirewallRule = new ResolverFirewallRule("exampleResolverFirewallRule", ResolverFirewallRuleArgs.builder()
            .name("example")
            .action("BLOCK")
            .blockOverrideDnsType("CNAME")
            .blockOverrideDomain("example.com")
            .blockOverrideTtl(1)
            .blockResponse("OVERRIDE")
            .firewallDomainListId(example.id())
            .firewallRuleGroupId(exampleResolverFirewallRuleGroup.id())
            .priority(100)
            .build());

    }
}
resources:
  example:
    type: aws:route53:ResolverFirewallDomainList
    properties:
      name: example
      domains:
        - example.com
      tags: {}
  exampleResolverFirewallRuleGroup:
    type: aws:route53:ResolverFirewallRuleGroup
    name: example
    properties:
      name: example
      tags: {}
  exampleResolverFirewallRule:
    type: aws:route53:ResolverFirewallRule
    name: example
    properties:
      name: example
      action: BLOCK
      blockOverrideDnsType: CNAME
      blockOverrideDomain: example.com
      blockOverrideTtl: 1
      blockResponse: OVERRIDE
      firewallDomainListId: ${example.id}
      firewallRuleGroupId: ${exampleResolverFirewallRuleGroup.id}
      priority: 100

DNS Firewall Advanced Rule

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.route53.ResolverFirewallRuleGroup("example", {
    name: "example",
    tags: {},
});
const exampleResolverFirewallRule = new aws.route53.ResolverFirewallRule("example", {
    name: "block-dga",
    action: "BLOCK",
    blockResponse: "NODATA",
    firewallRuleGroupId: example.id,
    dnsThreatProtection: "DGA",
    confidenceThreshold: "HIGH",
    priority: 100,
});
import pulumi
import pulumi_aws as aws

example = aws.route53.ResolverFirewallRuleGroup("example",
    name="example",
    tags={})
example_resolver_firewall_rule = aws.route53.ResolverFirewallRule("example",
    name="block-dga",
    action="BLOCK",
    block_response="NODATA",
    firewall_rule_group_id=example.id,
    dns_threat_protection="DGA",
    confidence_threshold="HIGH",
    priority=100)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Route53.ResolverFirewallRuleGroup("example", new()
    {
        Name = "example",
        Tags = null,
    });

    var exampleResolverFirewallRule = new Aws.Route53.ResolverFirewallRule("example", new()
    {
        Name = "block-dga",
        Action = "BLOCK",
        BlockResponse = "NODATA",
        FirewallRuleGroupId = example.Id,
        DnsThreatProtection = "DGA",
        ConfidenceThreshold = "HIGH",
        Priority = 100,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/route53"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := route53.NewResolverFirewallRuleGroup(ctx, "example", &route53.ResolverFirewallRuleGroupArgs{
			Name: pulumi.String("example"),
			Tags: pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		_, err = route53.NewResolverFirewallRule(ctx, "example", &route53.ResolverFirewallRuleArgs{
			Name:                pulumi.String("block-dga"),
			Action:              pulumi.String("BLOCK"),
			BlockResponse:       pulumi.String("NODATA"),
			FirewallRuleGroupId: example.ID().ToIDOutput().ToStringOutput(),
			DnsThreatProtection: pulumi.String("DGA"),
			ConfidenceThreshold: pulumi.String("HIGH"),
			Priority:            pulumi.Int(100),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_route53_resolverfirewallrulegroup" "example" {
  name = "example"
  tags = {}
}
resource "aws_route53_resolverfirewallrule" "example" {
  name                   = "block-dga"
  action                 = "BLOCK"
  block_response         = "NODATA"
  firewall_rule_group_id = aws_route53_resolverfirewallrulegroup.example.id
  dns_threat_protection  = "DGA"
  confidence_threshold   = "HIGH"
  priority               = 100
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.ResolverFirewallRuleGroup;
import com.pulumi.aws.route53.ResolverFirewallRuleGroupArgs;
import com.pulumi.aws.route53.ResolverFirewallRule;
import com.pulumi.aws.route53.ResolverFirewallRuleArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ResolverFirewallRuleGroup("example", ResolverFirewallRuleGroupArgs.builder()
            .name("example")
            .tags(Map.ofEntries(
            ))
            .build());

        var exampleResolverFirewallRule = new ResolverFirewallRule("exampleResolverFirewallRule", ResolverFirewallRuleArgs.builder()
            .name("block-dga")
            .action("BLOCK")
            .blockResponse("NODATA")
            .firewallRuleGroupId(example.id())
            .dnsThreatProtection("DGA")
            .confidenceThreshold("HIGH")
            .priority(100)
            .build());

    }
}
resources:
  example:
    type: aws:route53:ResolverFirewallRuleGroup
    properties:
      name: example
      tags: {}
  exampleResolverFirewallRule:
    type: aws:route53:ResolverFirewallRule
    name: example
    properties:
      name: block-dga
      action: BLOCK
      blockResponse: NODATA
      firewallRuleGroupId: ${example.id}
      dnsThreatProtection: DGA
      confidenceThreshold: HIGH
      priority: 100

Import

DNS Firewall Advanced rule:

Using pulumi import, import Route 53 Resolver DNS Firewall rules using the Route 53 Resolver DNS Firewall rule group ID and domain list ID (for standard rules) or threat protection ID (for advanced rules) separated by ':'. For example:

$ pulumi import aws:route53/resolverFirewallRule:ResolverFirewallRule example rslvr-frg-0123456789abcdef:rslvr-fdl-0123456789abcdef

Constructors

ResolverFirewallRule(String name, {ResolverFirewallRuleArgs? args, CustomResourceOptions? options})
Creates a new ResolverFirewallRule. name The Pulumi resource name. args Arguments used to configure this ResolverFirewallRule. The set of arguments for ResolverFirewallRule. options Resource options controlling this resource's behavior.
ResolverFirewallRule.reference(String urn)
Creates a typed reference to an existing ResolverFirewallRule resource.

Properties

action ↔ Output<String>
The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list, or a threat in a DNS Firewall Advanced rule. Valid values: ALLOW, BLOCK, ALERT. Note: ALLOW is not valid for DNS Firewall Advanced rules.
latefinal
blockOverrideDnsType ↔ Output<String?>
The DNS record's type. This determines the format of the record value that you provided in BlockOverrideDomain. Value values: CNAME.
latefinal
blockOverrideDomain ↔ Output<String?>
The custom DNS record to send back in response to the query.
latefinal
blockOverrideTtl ↔ Output<int?>
The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Minimum value of 0. Maximum value of 604800.
latefinal
blockResponse ↔ Output<String?>
The way that you want DNS Firewall to block the request. Valid values: NODATA, NXDOMAIN, OVERRIDE.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
confidenceThreshold ↔ Output<String?>
The confidence threshold for DNS Firewall Advanced rules. You must provide this value when creating a DNS Firewall Advanced rule. Valid values: LOW, MEDIUM, HIGH. Conflicts with firewallDomainListId.
latefinal
dnsThreatProtection ↔ Output<String?>
The type of DNS Firewall Advanced rule. You must provide this value when creating a DNS Firewall Advanced rule. Valid values: DGA, DICTIONARY_DGA, DNS_TUNNELING. Conflicts with firewallDomainListId.
latefinal
firewallDomainListId ↔ Output<String?>
The ID of the domain list that you want to use in the rule. Required for standard rules. Conflicts with dnsThreatProtection and confidenceThreshold.
latefinal
firewallDomainRedirectionAction ↔ Output<String?>
Evaluate DNS redirection in the DNS redirection chain, such as CNAME, DNAME, ot ALIAS. Valid values are INSPECT_REDIRECTION_DOMAIN and TRUST_REDIRECTION_DOMAIN. Default value is INSPECT_REDIRECTION_DOMAIN.
latefinal
firewallRuleGroupId ↔ Output<String>
The unique identifier of the firewall rule group where you want to create the rule.
latefinal
firewallThreatProtectionId ↔ Output<String>
The ID of the DNS Firewall Advanced rule. Only set for DNS Firewall Advanced rules.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
A name that lets you identify the rule, to manage and use it.
latefinal
priority ↔ Output<int>
The setting that determines the processing order of the rule in the rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.
latefinal
qType ↔ Output<String?>
The query type you want the rule to evaluate. Additional details can be found here
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ResolverFirewallRuleState? state, CustomResourceOptions? options}) → ResolverFirewallRule
Gets an existing ResolverFirewallRule resource's state with the given name and id.