1. Packages
  2. Ibm Provider
  3. API Docs
  4. DnsCustomResolverForwardingRule
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.DnsCustomResolverForwardingRule

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a resource for ibm_dns_custom_resolver_forwarding_rule. This allows Forwarding Rule to be created, updated and deleted.For more information, about Forwarding Rules, see create-forwarding-rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const rg = ibm.getResourceGroup({
        isDefault: true,
    });
    const test_pdns_cr_vpc = new ibm.IsVpc("test-pdns-cr-vpc", {resourceGroup: rg.then(rg => rg.id)});
    const test_pdns_cr_subnet1 = new ibm.IsSubnet("test-pdns-cr-subnet1", {
        vpc: test_pdns_cr_vpc.isVpcId,
        zone: "us-south-1",
        ipv4CidrBlock: "10.240.0.0/24",
        resourceGroup: rg.then(rg => rg.id),
    });
    const test_pdns_cr_subnet2 = new ibm.IsSubnet("test-pdns-cr-subnet2", {
        vpc: test_pdns_cr_vpc.isVpcId,
        zone: "us-south-1",
        ipv4CidrBlock: "10.240.64.0/24",
        resourceGroup: rg.then(rg => rg.id),
    });
    const test_pdns_cr_instance = new ibm.ResourceInstance("test-pdns-cr-instance", {
        resourceGroupId: rg.then(rg => rg.id),
        location: "global",
        service: "dns-svcs",
        plan: "standard-dns",
    });
    const test = new ibm.DnsCustomResolver("test", {
        instanceId: test_pdns_cr_instance.guid,
        description: "new test CR - TF",
        enabled: true,
        locations: [
            {
                subnetCrn: test_pdns_cr_subnet1.crn,
                enabled: true,
            },
            {
                subnetCrn: test_pdns_cr_subnet2.crn,
                enabled: true,
            },
        ],
    });
    const dnsCustomResolverForwardingRule = new ibm.DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRule", {
        instanceId: test_pdns_cr_instance.guid,
        resolverId: test.customResolverId,
        description: "Test Fw Rule",
        type: "zone",
        match: "test.example.com",
        forwardTos: ["168.20.22.122"],
        views: [{
            name: "view-example-1",
            description: "view example 1",
            expression: "ipInRange(source.ip, '10.240.0.0/24') || ipInRange(source.ip, '10.240.1.0/24')",
            forwardTos: [
                "10.240.2.6",
                "10.240.2.7",
            ],
        }],
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    rg = ibm.get_resource_group(is_default=True)
    test_pdns_cr_vpc = ibm.IsVpc("test-pdns-cr-vpc", resource_group=rg.id)
    test_pdns_cr_subnet1 = ibm.IsSubnet("test-pdns-cr-subnet1",
        vpc=test_pdns_cr_vpc.is_vpc_id,
        zone="us-south-1",
        ipv4_cidr_block="10.240.0.0/24",
        resource_group=rg.id)
    test_pdns_cr_subnet2 = ibm.IsSubnet("test-pdns-cr-subnet2",
        vpc=test_pdns_cr_vpc.is_vpc_id,
        zone="us-south-1",
        ipv4_cidr_block="10.240.64.0/24",
        resource_group=rg.id)
    test_pdns_cr_instance = ibm.ResourceInstance("test-pdns-cr-instance",
        resource_group_id=rg.id,
        location="global",
        service="dns-svcs",
        plan="standard-dns")
    test = ibm.DnsCustomResolver("test",
        instance_id=test_pdns_cr_instance.guid,
        description="new test CR - TF",
        enabled=True,
        locations=[
            {
                "subnet_crn": test_pdns_cr_subnet1.crn,
                "enabled": True,
            },
            {
                "subnet_crn": test_pdns_cr_subnet2.crn,
                "enabled": True,
            },
        ])
    dns_custom_resolver_forwarding_rule = ibm.DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRule",
        instance_id=test_pdns_cr_instance.guid,
        resolver_id=test.custom_resolver_id,
        description="Test Fw Rule",
        type="zone",
        match="test.example.com",
        forward_tos=["168.20.22.122"],
        views=[{
            "name": "view-example-1",
            "description": "view example 1",
            "expression": "ipInRange(source.ip, '10.240.0.0/24') || ipInRange(source.ip, '10.240.1.0/24')",
            "forward_tos": [
                "10.240.2.6",
                "10.240.2.7",
            ],
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		rg, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
    			IsDefault: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		test_pdns_cr_vpc, err := ibm.NewIsVpc(ctx, "test-pdns-cr-vpc", &ibm.IsVpcArgs{
    			ResourceGroup: pulumi.String(rg.Id),
    		})
    		if err != nil {
    			return err
    		}
    		test_pdns_cr_subnet1, err := ibm.NewIsSubnet(ctx, "test-pdns-cr-subnet1", &ibm.IsSubnetArgs{
    			Vpc:           test_pdns_cr_vpc.IsVpcId,
    			Zone:          pulumi.String("us-south-1"),
    			Ipv4CidrBlock: pulumi.String("10.240.0.0/24"),
    			ResourceGroup: pulumi.String(rg.Id),
    		})
    		if err != nil {
    			return err
    		}
    		test_pdns_cr_subnet2, err := ibm.NewIsSubnet(ctx, "test-pdns-cr-subnet2", &ibm.IsSubnetArgs{
    			Vpc:           test_pdns_cr_vpc.IsVpcId,
    			Zone:          pulumi.String("us-south-1"),
    			Ipv4CidrBlock: pulumi.String("10.240.64.0/24"),
    			ResourceGroup: pulumi.String(rg.Id),
    		})
    		if err != nil {
    			return err
    		}
    		test_pdns_cr_instance, err := ibm.NewResourceInstance(ctx, "test-pdns-cr-instance", &ibm.ResourceInstanceArgs{
    			ResourceGroupId: pulumi.String(rg.Id),
    			Location:        pulumi.String("global"),
    			Service:         pulumi.String("dns-svcs"),
    			Plan:            pulumi.String("standard-dns"),
    		})
    		if err != nil {
    			return err
    		}
    		test, err := ibm.NewDnsCustomResolver(ctx, "test", &ibm.DnsCustomResolverArgs{
    			InstanceId:  test_pdns_cr_instance.Guid,
    			Description: pulumi.String("new test CR - TF"),
    			Enabled:     pulumi.Bool(true),
    			Locations: ibm.DnsCustomResolverLocationArray{
    				&ibm.DnsCustomResolverLocationArgs{
    					SubnetCrn: test_pdns_cr_subnet1.Crn,
    					Enabled:   pulumi.Bool(true),
    				},
    				&ibm.DnsCustomResolverLocationArgs{
    					SubnetCrn: test_pdns_cr_subnet2.Crn,
    					Enabled:   pulumi.Bool(true),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsCustomResolverForwardingRule(ctx, "dnsCustomResolverForwardingRule", &ibm.DnsCustomResolverForwardingRuleArgs{
    			InstanceId:  test_pdns_cr_instance.Guid,
    			ResolverId:  test.CustomResolverId,
    			Description: pulumi.String("Test Fw Rule"),
    			Type:        pulumi.String("zone"),
    			Match:       pulumi.String("test.example.com"),
    			ForwardTos: pulumi.StringArray{
    				pulumi.String("168.20.22.122"),
    			},
    			Views: ibm.DnsCustomResolverForwardingRuleViewArray{
    				&ibm.DnsCustomResolverForwardingRuleViewArgs{
    					Name:        pulumi.String("view-example-1"),
    					Description: pulumi.String("view example 1"),
    					Expression:  pulumi.String("ipInRange(source.ip, '10.240.0.0/24') || ipInRange(source.ip, '10.240.1.0/24')"),
    					ForwardTos: pulumi.StringArray{
    						pulumi.String("10.240.2.6"),
    						pulumi.String("10.240.2.7"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var rg = Ibm.GetResourceGroup.Invoke(new()
        {
            IsDefault = true,
        });
    
        var test_pdns_cr_vpc = new Ibm.IsVpc("test-pdns-cr-vpc", new()
        {
            ResourceGroup = rg.Apply(getResourceGroupResult => getResourceGroupResult.Id),
        });
    
        var test_pdns_cr_subnet1 = new Ibm.IsSubnet("test-pdns-cr-subnet1", new()
        {
            Vpc = test_pdns_cr_vpc.IsVpcId,
            Zone = "us-south-1",
            Ipv4CidrBlock = "10.240.0.0/24",
            ResourceGroup = rg.Apply(getResourceGroupResult => getResourceGroupResult.Id),
        });
    
        var test_pdns_cr_subnet2 = new Ibm.IsSubnet("test-pdns-cr-subnet2", new()
        {
            Vpc = test_pdns_cr_vpc.IsVpcId,
            Zone = "us-south-1",
            Ipv4CidrBlock = "10.240.64.0/24",
            ResourceGroup = rg.Apply(getResourceGroupResult => getResourceGroupResult.Id),
        });
    
        var test_pdns_cr_instance = new Ibm.ResourceInstance("test-pdns-cr-instance", new()
        {
            ResourceGroupId = rg.Apply(getResourceGroupResult => getResourceGroupResult.Id),
            Location = "global",
            Service = "dns-svcs",
            Plan = "standard-dns",
        });
    
        var test = new Ibm.DnsCustomResolver("test", new()
        {
            InstanceId = test_pdns_cr_instance.Guid,
            Description = "new test CR - TF",
            Enabled = true,
            Locations = new[]
            {
                new Ibm.Inputs.DnsCustomResolverLocationArgs
                {
                    SubnetCrn = test_pdns_cr_subnet1.Crn,
                    Enabled = true,
                },
                new Ibm.Inputs.DnsCustomResolverLocationArgs
                {
                    SubnetCrn = test_pdns_cr_subnet2.Crn,
                    Enabled = true,
                },
            },
        });
    
        var dnsCustomResolverForwardingRule = new Ibm.DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRule", new()
        {
            InstanceId = test_pdns_cr_instance.Guid,
            ResolverId = test.CustomResolverId,
            Description = "Test Fw Rule",
            Type = "zone",
            Match = "test.example.com",
            ForwardTos = new[]
            {
                "168.20.22.122",
            },
            Views = new[]
            {
                new Ibm.Inputs.DnsCustomResolverForwardingRuleViewArgs
                {
                    Name = "view-example-1",
                    Description = "view example 1",
                    Expression = "ipInRange(source.ip, '10.240.0.0/24') || ipInRange(source.ip, '10.240.1.0/24')",
                    ForwardTos = new[]
                    {
                        "10.240.2.6",
                        "10.240.2.7",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetResourceGroupArgs;
    import com.pulumi.ibm.IsVpc;
    import com.pulumi.ibm.IsVpcArgs;
    import com.pulumi.ibm.IsSubnet;
    import com.pulumi.ibm.IsSubnetArgs;
    import com.pulumi.ibm.ResourceInstance;
    import com.pulumi.ibm.ResourceInstanceArgs;
    import com.pulumi.ibm.DnsCustomResolver;
    import com.pulumi.ibm.DnsCustomResolverArgs;
    import com.pulumi.ibm.inputs.DnsCustomResolverLocationArgs;
    import com.pulumi.ibm.DnsCustomResolverForwardingRule;
    import com.pulumi.ibm.DnsCustomResolverForwardingRuleArgs;
    import com.pulumi.ibm.inputs.DnsCustomResolverForwardingRuleViewArgs;
    import java.util.List;
    import java.util.ArrayList;
    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) {
            final var rg = IbmFunctions.getResourceGroup(GetResourceGroupArgs.builder()
                .isDefault(true)
                .build());
    
            var test_pdns_cr_vpc = new IsVpc("test-pdns-cr-vpc", IsVpcArgs.builder()
                .resourceGroup(rg.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .build());
    
            var test_pdns_cr_subnet1 = new IsSubnet("test-pdns-cr-subnet1", IsSubnetArgs.builder()
                .vpc(test_pdns_cr_vpc.isVpcId())
                .zone("us-south-1")
                .ipv4CidrBlock("10.240.0.0/24")
                .resourceGroup(rg.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .build());
    
            var test_pdns_cr_subnet2 = new IsSubnet("test-pdns-cr-subnet2", IsSubnetArgs.builder()
                .vpc(test_pdns_cr_vpc.isVpcId())
                .zone("us-south-1")
                .ipv4CidrBlock("10.240.64.0/24")
                .resourceGroup(rg.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .build());
    
            var test_pdns_cr_instance = new ResourceInstance("test-pdns-cr-instance", ResourceInstanceArgs.builder()
                .resourceGroupId(rg.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .location("global")
                .service("dns-svcs")
                .plan("standard-dns")
                .build());
    
            var test = new DnsCustomResolver("test", DnsCustomResolverArgs.builder()
                .instanceId(test_pdns_cr_instance.guid())
                .description("new test CR - TF")
                .enabled(true)
                .locations(            
                    DnsCustomResolverLocationArgs.builder()
                        .subnetCrn(test_pdns_cr_subnet1.crn())
                        .enabled(true)
                        .build(),
                    DnsCustomResolverLocationArgs.builder()
                        .subnetCrn(test_pdns_cr_subnet2.crn())
                        .enabled(true)
                        .build())
                .build());
    
            var dnsCustomResolverForwardingRule = new DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRule", DnsCustomResolverForwardingRuleArgs.builder()
                .instanceId(test_pdns_cr_instance.guid())
                .resolverId(test.customResolverId())
                .description("Test Fw Rule")
                .type("zone")
                .match("test.example.com")
                .forwardTos("168.20.22.122")
                .views(DnsCustomResolverForwardingRuleViewArgs.builder()
                    .name("view-example-1")
                    .description("view example 1")
                    .expression("ipInRange(source.ip, '10.240.0.0/24') || ipInRange(source.ip, '10.240.1.0/24')")
                    .forwardTos(                
                        "10.240.2.6",
                        "10.240.2.7")
                    .build())
                .build());
    
        }
    }
    
    resources:
      test-pdns-cr-vpc:
        type: ibm:IsVpc
        properties:
          resourceGroup: ${rg.id}
      test-pdns-cr-subnet1:
        type: ibm:IsSubnet
        properties:
          vpc: ${["test-pdns-cr-vpc"].isVpcId}
          zone: us-south-1
          ipv4CidrBlock: 10.240.0.0/24
          resourceGroup: ${rg.id}
      test-pdns-cr-subnet2:
        type: ibm:IsSubnet
        properties:
          vpc: ${["test-pdns-cr-vpc"].isVpcId}
          zone: us-south-1
          ipv4CidrBlock: 10.240.64.0/24
          resourceGroup: ${rg.id}
      test-pdns-cr-instance:
        type: ibm:ResourceInstance
        properties:
          resourceGroupId: ${rg.id}
          location: global
          service: dns-svcs
          plan: standard-dns
      test:
        type: ibm:DnsCustomResolver
        properties:
          instanceId: ${["test-pdns-cr-instance"].guid}
          description: new test CR - TF
          enabled: true
          locations:
            - subnetCrn: ${["test-pdns-cr-subnet1"].crn}
              enabled: true
            - subnetCrn: ${["test-pdns-cr-subnet2"].crn}
              enabled: true
      dnsCustomResolverForwardingRule:
        type: ibm:DnsCustomResolverForwardingRule
        properties:
          instanceId: ${["test-pdns-cr-instance"].guid}
          resolverId: ${test.customResolverId}
          description: Test Fw Rule
          type: zone
          match: test.example.com
          forwardTos:
            - 168.20.22.122
          views:
            - name: view-example-1
              description: view example 1
              expression: ipInRange(source.ip, '10.240.0.0/24') || ipInRange(source.ip, '10.240.1.0/24')
              forwardTos:
                - 10.240.2.6
                - 10.240.2.7
    variables:
      rg:
        fn::invoke:
          function: ibm:getResourceGroup
          arguments:
            isDefault: true
    

    Create DnsCustomResolverForwardingRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DnsCustomResolverForwardingRule(name: string, args: DnsCustomResolverForwardingRuleArgs, opts?: CustomResourceOptions);
    @overload
    def DnsCustomResolverForwardingRule(resource_name: str,
                                        args: DnsCustomResolverForwardingRuleArgs,
                                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def DnsCustomResolverForwardingRule(resource_name: str,
                                        opts: Optional[ResourceOptions] = None,
                                        instance_id: Optional[str] = None,
                                        resolver_id: Optional[str] = None,
                                        description: Optional[str] = None,
                                        dns_custom_resolver_forwarding_rule_id: Optional[str] = None,
                                        forward_tos: Optional[Sequence[str]] = None,
                                        match: Optional[str] = None,
                                        type: Optional[str] = None,
                                        views: Optional[Sequence[DnsCustomResolverForwardingRuleViewArgs]] = None)
    func NewDnsCustomResolverForwardingRule(ctx *Context, name string, args DnsCustomResolverForwardingRuleArgs, opts ...ResourceOption) (*DnsCustomResolverForwardingRule, error)
    public DnsCustomResolverForwardingRule(string name, DnsCustomResolverForwardingRuleArgs args, CustomResourceOptions? opts = null)
    public DnsCustomResolverForwardingRule(String name, DnsCustomResolverForwardingRuleArgs args)
    public DnsCustomResolverForwardingRule(String name, DnsCustomResolverForwardingRuleArgs args, CustomResourceOptions options)
    
    type: ibm:DnsCustomResolverForwardingRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args DnsCustomResolverForwardingRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args DnsCustomResolverForwardingRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args DnsCustomResolverForwardingRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DnsCustomResolverForwardingRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DnsCustomResolverForwardingRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var dnsCustomResolverForwardingRuleResource = new Ibm.DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRuleResource", new()
    {
        InstanceId = "string",
        ResolverId = "string",
        Description = "string",
        DnsCustomResolverForwardingRuleId = "string",
        ForwardTos = new[]
        {
            "string",
        },
        Match = "string",
        Type = "string",
        Views = new[]
        {
            new Ibm.Inputs.DnsCustomResolverForwardingRuleViewArgs
            {
                Expression = "string",
                ForwardTos = new[]
                {
                    "string",
                },
                Name = "string",
                Description = "string",
            },
        },
    });
    
    example, err := ibm.NewDnsCustomResolverForwardingRule(ctx, "dnsCustomResolverForwardingRuleResource", &ibm.DnsCustomResolverForwardingRuleArgs{
    	InstanceId:                        pulumi.String("string"),
    	ResolverId:                        pulumi.String("string"),
    	Description:                       pulumi.String("string"),
    	DnsCustomResolverForwardingRuleId: pulumi.String("string"),
    	ForwardTos: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Match: pulumi.String("string"),
    	Type:  pulumi.String("string"),
    	Views: ibm.DnsCustomResolverForwardingRuleViewArray{
    		&ibm.DnsCustomResolverForwardingRuleViewArgs{
    			Expression: pulumi.String("string"),
    			ForwardTos: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Name:        pulumi.String("string"),
    			Description: pulumi.String("string"),
    		},
    	},
    })
    
    var dnsCustomResolverForwardingRuleResource = new DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRuleResource", DnsCustomResolverForwardingRuleArgs.builder()
        .instanceId("string")
        .resolverId("string")
        .description("string")
        .dnsCustomResolverForwardingRuleId("string")
        .forwardTos("string")
        .match("string")
        .type("string")
        .views(DnsCustomResolverForwardingRuleViewArgs.builder()
            .expression("string")
            .forwardTos("string")
            .name("string")
            .description("string")
            .build())
        .build());
    
    dns_custom_resolver_forwarding_rule_resource = ibm.DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRuleResource",
        instance_id="string",
        resolver_id="string",
        description="string",
        dns_custom_resolver_forwarding_rule_id="string",
        forward_tos=["string"],
        match="string",
        type="string",
        views=[{
            "expression": "string",
            "forward_tos": ["string"],
            "name": "string",
            "description": "string",
        }])
    
    const dnsCustomResolverForwardingRuleResource = new ibm.DnsCustomResolverForwardingRule("dnsCustomResolverForwardingRuleResource", {
        instanceId: "string",
        resolverId: "string",
        description: "string",
        dnsCustomResolverForwardingRuleId: "string",
        forwardTos: ["string"],
        match: "string",
        type: "string",
        views: [{
            expression: "string",
            forwardTos: ["string"],
            name: "string",
            description: "string",
        }],
    });
    
    type: ibm:DnsCustomResolverForwardingRule
    properties:
        description: string
        dnsCustomResolverForwardingRuleId: string
        forwardTos:
            - string
        instanceId: string
        match: string
        resolverId: string
        type: string
        views:
            - description: string
              expression: string
              forwardTos:
                - string
              name: string
    

    DnsCustomResolverForwardingRule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The DnsCustomResolverForwardingRule resource accepts the following input properties:

    InstanceId string
    The GUID of the private DNS service instance.
    ResolverId string
    The unique identifier of a custom resolver.
    Description string
    Descriptive text of the forwarding rule.
    DnsCustomResolverForwardingRuleId string
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    ForwardTos List<string>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    Match string
    The matching zone or hostname.
    Type string
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    Views List<DnsCustomResolverForwardingRuleView>

    List of views attached to the custom resolver.

    Nested scheme for views:

    InstanceId string
    The GUID of the private DNS service instance.
    ResolverId string
    The unique identifier of a custom resolver.
    Description string
    Descriptive text of the forwarding rule.
    DnsCustomResolverForwardingRuleId string
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    ForwardTos []string
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    Match string
    The matching zone or hostname.
    Type string
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    Views []DnsCustomResolverForwardingRuleViewArgs

    List of views attached to the custom resolver.

    Nested scheme for views:

    instanceId String
    The GUID of the private DNS service instance.
    resolverId String
    The unique identifier of a custom resolver.
    description String
    Descriptive text of the forwarding rule.
    dnsCustomResolverForwardingRuleId String
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forwardTos List<String>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    match String
    The matching zone or hostname.
    type String
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views List<DnsCustomResolverForwardingRuleView>

    List of views attached to the custom resolver.

    Nested scheme for views:

    instanceId string
    The GUID of the private DNS service instance.
    resolverId string
    The unique identifier of a custom resolver.
    description string
    Descriptive text of the forwarding rule.
    dnsCustomResolverForwardingRuleId string
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forwardTos string[]
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    match string
    The matching zone or hostname.
    type string
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views DnsCustomResolverForwardingRuleView[]

    List of views attached to the custom resolver.

    Nested scheme for views:

    instance_id str
    The GUID of the private DNS service instance.
    resolver_id str
    The unique identifier of a custom resolver.
    description str
    Descriptive text of the forwarding rule.
    dns_custom_resolver_forwarding_rule_id str
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forward_tos Sequence[str]
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    match str
    The matching zone or hostname.
    type str
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views Sequence[DnsCustomResolverForwardingRuleViewArgs]

    List of views attached to the custom resolver.

    Nested scheme for views:

    instanceId String
    The GUID of the private DNS service instance.
    resolverId String
    The unique identifier of a custom resolver.
    description String
    Descriptive text of the forwarding rule.
    dnsCustomResolverForwardingRuleId String
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forwardTos List<String>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    match String
    The matching zone or hostname.
    type String
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views List<Property Map>

    List of views attached to the custom resolver.

    Nested scheme for views:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DnsCustomResolverForwardingRule resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId string
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId string
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId String
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    id string
    The provider-assigned unique ID for this managed resource.
    ruleId string
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    id str
    The provider-assigned unique ID for this managed resource.
    rule_id str
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId String
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.

    Look up Existing DnsCustomResolverForwardingRule Resource

    Get an existing DnsCustomResolverForwardingRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: DnsCustomResolverForwardingRuleState, opts?: CustomResourceOptions): DnsCustomResolverForwardingRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            dns_custom_resolver_forwarding_rule_id: Optional[str] = None,
            forward_tos: Optional[Sequence[str]] = None,
            instance_id: Optional[str] = None,
            match: Optional[str] = None,
            resolver_id: Optional[str] = None,
            rule_id: Optional[str] = None,
            type: Optional[str] = None,
            views: Optional[Sequence[DnsCustomResolverForwardingRuleViewArgs]] = None) -> DnsCustomResolverForwardingRule
    func GetDnsCustomResolverForwardingRule(ctx *Context, name string, id IDInput, state *DnsCustomResolverForwardingRuleState, opts ...ResourceOption) (*DnsCustomResolverForwardingRule, error)
    public static DnsCustomResolverForwardingRule Get(string name, Input<string> id, DnsCustomResolverForwardingRuleState? state, CustomResourceOptions? opts = null)
    public static DnsCustomResolverForwardingRule get(String name, Output<String> id, DnsCustomResolverForwardingRuleState state, CustomResourceOptions options)
    resources:  _:    type: ibm:DnsCustomResolverForwardingRule    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    Descriptive text of the forwarding rule.
    DnsCustomResolverForwardingRuleId string
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    ForwardTos List<string>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    InstanceId string
    The GUID of the private DNS service instance.
    Match string
    The matching zone or hostname.
    ResolverId string
    The unique identifier of a custom resolver.
    RuleId string
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    Type string
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    Views List<DnsCustomResolverForwardingRuleView>

    List of views attached to the custom resolver.

    Nested scheme for views:

    Description string
    Descriptive text of the forwarding rule.
    DnsCustomResolverForwardingRuleId string
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    ForwardTos []string
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    InstanceId string
    The GUID of the private DNS service instance.
    Match string
    The matching zone or hostname.
    ResolverId string
    The unique identifier of a custom resolver.
    RuleId string
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    Type string
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    Views []DnsCustomResolverForwardingRuleViewArgs

    List of views attached to the custom resolver.

    Nested scheme for views:

    description String
    Descriptive text of the forwarding rule.
    dnsCustomResolverForwardingRuleId String
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forwardTos List<String>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    instanceId String
    The GUID of the private DNS service instance.
    match String
    The matching zone or hostname.
    resolverId String
    The unique identifier of a custom resolver.
    ruleId String
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    type String
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views List<DnsCustomResolverForwardingRuleView>

    List of views attached to the custom resolver.

    Nested scheme for views:

    description string
    Descriptive text of the forwarding rule.
    dnsCustomResolverForwardingRuleId string
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forwardTos string[]
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    instanceId string
    The GUID of the private DNS service instance.
    match string
    The matching zone or hostname.
    resolverId string
    The unique identifier of a custom resolver.
    ruleId string
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    type string
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views DnsCustomResolverForwardingRuleView[]

    List of views attached to the custom resolver.

    Nested scheme for views:

    description str
    Descriptive text of the forwarding rule.
    dns_custom_resolver_forwarding_rule_id str
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forward_tos Sequence[str]
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    instance_id str
    The GUID of the private DNS service instance.
    match str
    The matching zone or hostname.
    resolver_id str
    The unique identifier of a custom resolver.
    rule_id str
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    type str
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views Sequence[DnsCustomResolverForwardingRuleViewArgs]

    List of views attached to the custom resolver.

    Nested scheme for views:

    description String
    Descriptive text of the forwarding rule.
    dnsCustomResolverForwardingRuleId String
    (String) The unique identifier of the DNS custom resolver forwarding rule.
    forwardTos List<String>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    instanceId String
    The GUID of the private DNS service instance.
    match String
    The matching zone or hostname.
    resolverId String
    The unique identifier of a custom resolver.
    ruleId String
    (String) The rule ID is unique identifier of the custom resolver forwarding rule.
    type String
    Type of the forwarding rule.

    • Constraints: Allowable values is: zone.
    views List<Property Map>

    List of views attached to the custom resolver.

    Nested scheme for views:

    Supporting Types

    DnsCustomResolverForwardingRuleView, DnsCustomResolverForwardingRuleViewArgs

    Expression string
    Expression of the view.
    ForwardTos List<string>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    Name string
    Name of the view.
    Description string
    Description of the view.
    Expression string
    Expression of the view.
    ForwardTos []string
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    Name string
    Name of the view.
    Description string
    Description of the view.
    expression String
    Expression of the view.
    forwardTos List<String>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    name String
    Name of the view.
    description String
    Description of the view.
    expression string
    Expression of the view.
    forwardTos string[]
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    name string
    Name of the view.
    description string
    Description of the view.
    expression str
    Expression of the view.
    forward_tos Sequence[str]
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    name str
    Name of the view.
    description str
    Description of the view.
    expression String
    Expression of the view.
    forwardTos List<String>
    List of the upstream DNS servers that the matching DNS queries will be forwarded to.
    name String
    Name of the view.
    description String
    Description of the view.

    Import

    You can import the ibm_dns_custom_resolver_forwarding_rule resource by using id.

    The id property can be formed from rule_id, resolver_id, and instance_id in the following format:

    terraform

    $ pulumi import ibm:index/dnsCustomResolverForwardingRule:DnsCustomResolverForwardingRule ibm_dns_custom_resolver_forwarding_rule <rule_id>:<resolver_id>:<instance_id>
    
    • rule_id: A String. The unique identifier of a forwarding rule.

    • resolver_id: A String. The unique identifier of a custom resolver.

    • instance_id: A String. The GUID of the private DNS service instance.

    terraform

    $ pulumi import ibm:index/dnsCustomResolverForwardingRule:DnsCustomResolverForwardingRule ibm_dns_custom_resolver_forwarding_rule <rule_id>:<resolver_id>:<instance_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud