ResolverRule class

Provides a Route53 Resolver rule.

Example Usage

System rule

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

const sys = new aws.route53.ResolverRule("sys", {
    domainName: "subdomain.example.com",
    ruleType: "SYSTEM",
});
import pulumi
import pulumi_aws as aws

sys = aws.route53.ResolverRule("sys",
    domain_name="subdomain.example.com",
    rule_type="SYSTEM")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var sys = new Aws.Route53.ResolverRule("sys", new()
    {
        DomainName = "subdomain.example.com",
        RuleType = "SYSTEM",
    });

});
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 {
		_, err := route53.NewResolverRule(ctx, "sys", &route53.ResolverRuleArgs{
			DomainName: pulumi.String("subdomain.example.com"),
			RuleType:   pulumi.String("SYSTEM"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_route53_resolverrule" "sys" {
  domain_name = "subdomain.example.com"
  rule_type   = "SYSTEM"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.ResolverRule;
import com.pulumi.aws.route53.ResolverRuleArgs;
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 sys = new ResolverRule("sys", ResolverRuleArgs.builder()
            .domainName("subdomain.example.com")
            .ruleType("SYSTEM")
            .build());

    }
}
resources:
  sys:
    type: aws:route53:ResolverRule
    properties:
      domainName: subdomain.example.com
      ruleType: SYSTEM

Forward rule

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

const fwd = new aws.route53.ResolverRule("fwd", {
    targetIps: [{
        ip: "123.45.67.89",
    }],
    domainName: "example.com",
    name: "example",
    ruleType: "FORWARD",
    resolverEndpointId: foo.id,
    tags: {
        Environment: "Prod",
    },
});
import pulumi
import pulumi_aws as aws

fwd = aws.route53.ResolverRule("fwd",
    target_ips=[{
        "ip": "123.45.67.89",
    }],
    domain_name="example.com",
    name="example",
    rule_type="FORWARD",
    resolver_endpoint_id=foo["id"],
    tags={
        "Environment": "Prod",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var fwd = new Aws.Route53.ResolverRule("fwd", new()
    {
        TargetIps = new[]
        {
            new Aws.Route53.Inputs.ResolverRuleTargetIpArgs
            {
                Ip = "123.45.67.89",
            },
        },
        DomainName = "example.com",
        Name = "example",
        RuleType = "FORWARD",
        ResolverEndpointId = foo.Id,
        Tags =
        {
            { "Environment", "Prod" },
        },
    });

});
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 {
		_, err := route53.NewResolverRule(ctx, "fwd", &route53.ResolverRuleArgs{
			TargetIps: route53.ResolverRuleTargetIpArray{
				&route53.ResolverRuleTargetIpArgs{
					Ip: pulumi.String("123.45.67.89"),
				},
			},
			DomainName:         pulumi.String("example.com"),
			Name:               pulumi.String("example"),
			RuleType:           pulumi.String("FORWARD"),
			ResolverEndpointId: pulumi.Any(foo.Id),
			Tags: pulumi.StringMap{
				"Environment": pulumi.String("Prod"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_route53_resolverrule" "fwd" {
  target_ips {
    ip = "123.45.67.89"
  }
  domain_name          = "example.com"
  name                 = "example"
  rule_type            = "FORWARD"
  resolver_endpoint_id = foo.id
  tags = {
    "Environment" = "Prod"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.ResolverRule;
import com.pulumi.aws.route53.ResolverRuleArgs;
import com.pulumi.aws.route53.inputs.ResolverRuleTargetIpArgs;
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 fwd = new ResolverRule("fwd", ResolverRuleArgs.builder()
            .targetIps(ResolverRuleTargetIpArgs.builder()
                .ip("123.45.67.89")
                .build())
            .domainName("example.com")
            .name("example")
            .ruleType("FORWARD")
            .resolverEndpointId(foo.id())
            .tags(Map.of("Environment", "Prod"))
            .build());

    }
}
resources:
  fwd:
    type: aws:route53:ResolverRule
    properties:
      targetIps:
        - ip: 123.45.67.89
      domainName: example.com
      name: example
      ruleType: FORWARD
      resolverEndpointId: ${foo.id}
      tags:
        Environment: Prod

IPv6 Forward rule

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

const fwd = new aws.route53.ResolverRule("fwd", {
    targetIps: [{
        ipv6: "2600:1f18:1686:2000:4e60:6e3e:258:da36",
    }],
    domainName: "example.com",
    name: "example",
    ruleType: "FORWARD",
    resolverEndpointId: foo.id,
    tags: {
        Environment: "Prod",
    },
});
import pulumi
import pulumi_aws as aws

fwd = aws.route53.ResolverRule("fwd",
    target_ips=[{
        "ipv6": "2600:1f18:1686:2000:4e60:6e3e:258:da36",
    }],
    domain_name="example.com",
    name="example",
    rule_type="FORWARD",
    resolver_endpoint_id=foo["id"],
    tags={
        "Environment": "Prod",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var fwd = new Aws.Route53.ResolverRule("fwd", new()
    {
        TargetIps = new[]
        {
            new Aws.Route53.Inputs.ResolverRuleTargetIpArgs
            {
                Ipv6 = "2600:1f18:1686:2000:4e60:6e3e:258:da36",
            },
        },
        DomainName = "example.com",
        Name = "example",
        RuleType = "FORWARD",
        ResolverEndpointId = foo.Id,
        Tags =
        {
            { "Environment", "Prod" },
        },
    });

});
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 {
		_, err := route53.NewResolverRule(ctx, "fwd", &route53.ResolverRuleArgs{
			TargetIps: route53.ResolverRuleTargetIpArray{
				&route53.ResolverRuleTargetIpArgs{
					Ipv6: pulumi.String("2600:1f18:1686:2000:4e60:6e3e:258:da36"),
				},
			},
			DomainName:         pulumi.String("example.com"),
			Name:               pulumi.String("example"),
			RuleType:           pulumi.String("FORWARD"),
			ResolverEndpointId: pulumi.Any(foo.Id),
			Tags: pulumi.StringMap{
				"Environment": pulumi.String("Prod"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_route53_resolverrule" "fwd" {
  target_ips {
    ipv6 = "2600:1f18:1686:2000:4e60:6e3e:258:da36"
  }
  domain_name          = "example.com"
  name                 = "example"
  rule_type            = "FORWARD"
  resolver_endpoint_id = foo.id
  tags = {
    "Environment" = "Prod"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.ResolverRule;
import com.pulumi.aws.route53.ResolverRuleArgs;
import com.pulumi.aws.route53.inputs.ResolverRuleTargetIpArgs;
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 fwd = new ResolverRule("fwd", ResolverRuleArgs.builder()
            .targetIps(ResolverRuleTargetIpArgs.builder()
                .ipv6("2600:1f18:1686:2000:4e60:6e3e:258:da36")
                .build())
            .domainName("example.com")
            .name("example")
            .ruleType("FORWARD")
            .resolverEndpointId(foo.id())
            .tags(Map.of("Environment", "Prod"))
            .build());

    }
}
resources:
  fwd:
    type: aws:route53:ResolverRule
    properties:
      targetIps:
        - ipv6: 2600:1f18:1686:2000:4e60:6e3e:258:da36
      domainName: example.com
      name: example
      ruleType: FORWARD
      resolverEndpointId: ${foo.id}
      tags:
        Environment: Prod

Import

Identity Schema

Required

  • id - (String) ID of the Route53 Resolver rule.

Optional

  • accountId (String) AWS Account where this resource is managed.
  • region (String) Region where this resource is managed.

Using pulumi import, import Route53 Resolver rules using the id. For example:

$ pulumi import aws:route53/resolverRule:ResolverRule example rslvr-rr-0123456789abcdef0

Constructors

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

Properties

arn ↔ Output<String>
ARN for the resolver rule.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
domainName ↔ Output<String>
DNS queries for this domain name are forwarded to the IP addresses that are specified using targetIp.
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>
Friendly name that lets you easily find a rule in the Resolver dashboard in the Route 53 console.
latefinal
ownerId ↔ Output<String>
When a rule is shared with another AWS account, the account ID of the account that the rule is shared with.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resolverEndpointId ↔ Output<String?>
ID of the outbound resolver endpoint that you want to use to route DNS queries to the IP addresses that you specify using targetIp. This argument should only be specified for FORWARD type rules.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
ruleType ↔ Output<String>
Rule type. Valid values are FORWARD, SYSTEM and RECURSIVE.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shareStatus ↔ Output<String>
Whether the rules is shared and, if so, whether the current account is sharing the rule with another account, or another account is sharing the rule with the current account. Values are NOT_SHARED, SHARED_BY_ME or SHARED_WITH_ME
latefinal
tags ↔ Output<Map<String, String>?>
Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
targetIps ↔ Output<List<ResolverRuleTargetIp>?>
Configuration block(s) indicating the IPs that you want Resolver to forward DNS queries to (documented below). This argument should only be specified for FORWARD type rules.
latefinal
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, {ResolverRuleState? state, CustomResourceOptions? options}) → ResolverRule
Gets an existing ResolverRule resource's state with the given name and id.