ForwardingRule

Describes a forwarding rule within a DNS forwarding ruleset. API Version: 2020-04-01-preview.

Example Usage

Upsert forwarding rule in a DNS forwarding ruleset

using System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var forwardingRule = new AzureNative.Network.ForwardingRule("forwardingRule", new()
    {
        DnsForwardingRulesetName = "sampleDnsForwardingRuleset",
        DomainName = "contoso.com.",
        ForwardingRuleName = "sampleForwardingRule",
        ForwardingRuleState = "Enabled",
        Metadata = 
        {
            { "additionalProp1", "value1" },
        },
        ResourceGroupName = "sampleResourceGroup",
        TargetDnsServers = new[]
        {
            new AzureNative.Network.Inputs.TargetDnsServerArgs
            {
                IpAddress = "10.0.0.1",
                Port = 53,
            },
            new AzureNative.Network.Inputs.TargetDnsServerArgs
            {
                IpAddress = "10.0.0.2",
                Port = 53,
            },
        },
    });

});
package main

import (
	network "github.com/pulumi/pulumi-azure-native/sdk/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewForwardingRule(ctx, "forwardingRule", &network.ForwardingRuleArgs{
			DnsForwardingRulesetName: pulumi.String("sampleDnsForwardingRuleset"),
			DomainName:               pulumi.String("contoso.com."),
			ForwardingRuleName:       pulumi.String("sampleForwardingRule"),
			ForwardingRuleState:      pulumi.String("Enabled"),
			Metadata: pulumi.StringMap{
				"additionalProp1": pulumi.String("value1"),
			},
			ResourceGroupName: pulumi.String("sampleResourceGroup"),
			TargetDnsServers: network.TargetDnsServerArray{
				&network.TargetDnsServerArgs{
					IpAddress: pulumi.String("10.0.0.1"),
					Port:      pulumi.Int(53),
				},
				&network.TargetDnsServerArgs{
					IpAddress: pulumi.String("10.0.0.2"),
					Port:      pulumi.Int(53),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.ForwardingRule;
import com.pulumi.azurenative.network.ForwardingRuleArgs;
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) {
        var forwardingRule = new ForwardingRule("forwardingRule", ForwardingRuleArgs.builder()        
            .dnsForwardingRulesetName("sampleDnsForwardingRuleset")
            .domainName("contoso.com.")
            .forwardingRuleName("sampleForwardingRule")
            .forwardingRuleState("Enabled")
            .metadata(Map.of("additionalProp1", "value1"))
            .resourceGroupName("sampleResourceGroup")
            .targetDnsServers(            
                Map.ofEntries(
                    Map.entry("ipAddress", "10.0.0.1"),
                    Map.entry("port", 53)
                ),
                Map.ofEntries(
                    Map.entry("ipAddress", "10.0.0.2"),
                    Map.entry("port", 53)
                ))
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

forwarding_rule = azure_native.network.ForwardingRule("forwardingRule",
    dns_forwarding_ruleset_name="sampleDnsForwardingRuleset",
    domain_name="contoso.com.",
    forwarding_rule_name="sampleForwardingRule",
    forwarding_rule_state="Enabled",
    metadata={
        "additionalProp1": "value1",
    },
    resource_group_name="sampleResourceGroup",
    target_dns_servers=[
        azure_native.network.TargetDnsServerArgs(
            ip_address="10.0.0.1",
            port=53,
        ),
        azure_native.network.TargetDnsServerArgs(
            ip_address="10.0.0.2",
            port=53,
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const forwardingRule = new azure_native.network.ForwardingRule("forwardingRule", {
    dnsForwardingRulesetName: "sampleDnsForwardingRuleset",
    domainName: "contoso.com.",
    forwardingRuleName: "sampleForwardingRule",
    forwardingRuleState: "Enabled",
    metadata: {
        additionalProp1: "value1",
    },
    resourceGroupName: "sampleResourceGroup",
    targetDnsServers: [
        {
            ipAddress: "10.0.0.1",
            port: 53,
        },
        {
            ipAddress: "10.0.0.2",
            port: 53,
        },
    ],
});
resources:
  forwardingRule:
    type: azure-native:network:ForwardingRule
    properties:
      dnsForwardingRulesetName: sampleDnsForwardingRuleset
      domainName: contoso.com.
      forwardingRuleName: sampleForwardingRule
      forwardingRuleState: Enabled
      metadata:
        additionalProp1: value1
      resourceGroupName: sampleResourceGroup
      targetDnsServers:
        - ipAddress: 10.0.0.1
          port: 53
        - ipAddress: 10.0.0.2
          port: 53

Create ForwardingRule Resource

new ForwardingRule(name: string, args: ForwardingRuleArgs, opts?: CustomResourceOptions);
@overload
def ForwardingRule(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   dns_forwarding_ruleset_name: Optional[str] = None,
                   domain_name: Optional[str] = None,
                   forwarding_rule_name: Optional[str] = None,
                   forwarding_rule_state: Optional[Union[str, ForwardingRuleState]] = None,
                   metadata: Optional[Mapping[str, str]] = None,
                   resource_group_name: Optional[str] = None,
                   target_dns_servers: Optional[Sequence[TargetDnsServerArgs]] = None)
@overload
def ForwardingRule(resource_name: str,
                   args: ForwardingRuleArgs,
                   opts: Optional[ResourceOptions] = None)
func NewForwardingRule(ctx *Context, name string, args ForwardingRuleArgs, opts ...ResourceOption) (*ForwardingRule, error)
public ForwardingRule(string name, ForwardingRuleArgs args, CustomResourceOptions? opts = null)
public ForwardingRule(String name, ForwardingRuleArgs args)
public ForwardingRule(String name, ForwardingRuleArgs args, CustomResourceOptions options)
type: azure-native:network:ForwardingRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ForwardingRuleArgs
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 ForwardingRuleArgs
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 ForwardingRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ForwardingRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ForwardingRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ForwardingRule Resource Properties

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

Inputs

The ForwardingRule resource accepts the following input properties:

DnsForwardingRulesetName string

The name of the DNS forwarding ruleset.

DomainName string

The domain name for the forwarding rule.

ResourceGroupName string

The name of the resource group. The name is case insensitive.

TargetDnsServers List<Pulumi.AzureNative.Network.Inputs.TargetDnsServerArgs>

DNS servers to forward the DNS query to.

ForwardingRuleName string

The name of the forwarding rule.

ForwardingRuleState string | Pulumi.AzureNative.Network.ForwardingRuleState

The state of forwarding rule.

Metadata Dictionary<string, string>

Metadata attached to the forwarding rule.

DnsForwardingRulesetName string

The name of the DNS forwarding ruleset.

DomainName string

The domain name for the forwarding rule.

ResourceGroupName string

The name of the resource group. The name is case insensitive.

TargetDnsServers []TargetDnsServerArgs

DNS servers to forward the DNS query to.

ForwardingRuleName string

The name of the forwarding rule.

ForwardingRuleState string | ForwardingRuleStateEnum

The state of forwarding rule.

Metadata map[string]string

Metadata attached to the forwarding rule.

dnsForwardingRulesetName String

The name of the DNS forwarding ruleset.

domainName String

The domain name for the forwarding rule.

resourceGroupName String

The name of the resource group. The name is case insensitive.

targetDnsServers List<TargetDnsServerArgs>

DNS servers to forward the DNS query to.

forwardingRuleName String

The name of the forwarding rule.

forwardingRuleState String | ForwardingRuleState

The state of forwarding rule.

metadata Map<String,String>

Metadata attached to the forwarding rule.

dnsForwardingRulesetName string

The name of the DNS forwarding ruleset.

domainName string

The domain name for the forwarding rule.

resourceGroupName string

The name of the resource group. The name is case insensitive.

targetDnsServers TargetDnsServerArgs[]

DNS servers to forward the DNS query to.

forwardingRuleName string

The name of the forwarding rule.

forwardingRuleState string | ForwardingRuleState

The state of forwarding rule.

metadata {[key: string]: string}

Metadata attached to the forwarding rule.

dns_forwarding_ruleset_name str

The name of the DNS forwarding ruleset.

domain_name str

The domain name for the forwarding rule.

resource_group_name str

The name of the resource group. The name is case insensitive.

target_dns_servers Sequence[TargetDnsServerArgs]

DNS servers to forward the DNS query to.

forwarding_rule_name str

The name of the forwarding rule.

forwarding_rule_state str | ForwardingRuleState

The state of forwarding rule.

metadata Mapping[str, str]

Metadata attached to the forwarding rule.

dnsForwardingRulesetName String

The name of the DNS forwarding ruleset.

domainName String

The domain name for the forwarding rule.

resourceGroupName String

The name of the resource group. The name is case insensitive.

targetDnsServers List<Property Map>

DNS servers to forward the DNS query to.

forwardingRuleName String

The name of the forwarding rule.

forwardingRuleState String | "Enabled" | "Disabled"

The state of forwarding rule.

metadata Map<String>

Metadata attached to the forwarding rule.

Outputs

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

Etag string

ETag of the forwarding rule.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the resource

ProvisioningState string

The current provisioning state of the forwarding rule. This is a read-only property and any attempt to set this value will be ignored.

SystemData Pulumi.AzureNative.Network.Outputs.SystemDataResponse

Metadata pertaining to creation and last modification of the resource.

Type string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Etag string

ETag of the forwarding rule.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the resource

ProvisioningState string

The current provisioning state of the forwarding rule. This is a read-only property and any attempt to set this value will be ignored.

SystemData SystemDataResponse

Metadata pertaining to creation and last modification of the resource.

Type string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

etag String

ETag of the forwarding rule.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the resource

provisioningState String

The current provisioning state of the forwarding rule. This is a read-only property and any attempt to set this value will be ignored.

systemData SystemDataResponse

Metadata pertaining to creation and last modification of the resource.

type String

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

etag string

ETag of the forwarding rule.

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the resource

provisioningState string

The current provisioning state of the forwarding rule. This is a read-only property and any attempt to set this value will be ignored.

systemData SystemDataResponse

Metadata pertaining to creation and last modification of the resource.

type string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

etag str

ETag of the forwarding rule.

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the resource

provisioning_state str

The current provisioning state of the forwarding rule. This is a read-only property and any attempt to set this value will be ignored.

system_data SystemDataResponse

Metadata pertaining to creation and last modification of the resource.

type str

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

etag String

ETag of the forwarding rule.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the resource

provisioningState String

The current provisioning state of the forwarding rule. This is a read-only property and any attempt to set this value will be ignored.

systemData Property Map

Metadata pertaining to creation and last modification of the resource.

type String

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Supporting Types

ForwardingRuleState

Enabled
Enabled
Disabled
Disabled
ForwardingRuleStateEnabled
Enabled
ForwardingRuleStateDisabled
Disabled
Enabled
Enabled
Disabled
Disabled
Enabled
Enabled
Disabled
Disabled
ENABLED
Enabled
DISABLED
Disabled
"Enabled"
Enabled
"Disabled"
Disabled

SystemDataResponse

CreatedAt string

The timestamp of resource creation (UTC).

CreatedBy string

The identity that created the resource.

CreatedByType string

The type of identity that created the resource.

LastModifiedAt string

The type of identity that last modified the resource.

LastModifiedBy string

The identity that last modified the resource.

LastModifiedByType string

The type of identity that last modified the resource.

CreatedAt string

The timestamp of resource creation (UTC).

CreatedBy string

The identity that created the resource.

CreatedByType string

The type of identity that created the resource.

LastModifiedAt string

The type of identity that last modified the resource.

LastModifiedBy string

The identity that last modified the resource.

LastModifiedByType string

The type of identity that last modified the resource.

createdAt String

The timestamp of resource creation (UTC).

createdBy String

The identity that created the resource.

createdByType String

The type of identity that created the resource.

lastModifiedAt String

The type of identity that last modified the resource.

lastModifiedBy String

The identity that last modified the resource.

lastModifiedByType String

The type of identity that last modified the resource.

createdAt string

The timestamp of resource creation (UTC).

createdBy string

The identity that created the resource.

createdByType string

The type of identity that created the resource.

lastModifiedAt string

The type of identity that last modified the resource.

lastModifiedBy string

The identity that last modified the resource.

lastModifiedByType string

The type of identity that last modified the resource.

created_at str

The timestamp of resource creation (UTC).

created_by str

The identity that created the resource.

created_by_type str

The type of identity that created the resource.

last_modified_at str

The type of identity that last modified the resource.

last_modified_by str

The identity that last modified the resource.

last_modified_by_type str

The type of identity that last modified the resource.

createdAt String

The timestamp of resource creation (UTC).

createdBy String

The identity that created the resource.

createdByType String

The type of identity that created the resource.

lastModifiedAt String

The type of identity that last modified the resource.

lastModifiedBy String

The identity that last modified the resource.

lastModifiedByType String

The type of identity that last modified the resource.

TargetDnsServer

IpAddress string

DNS server IP address.

Port int

DNS server port.

IpAddress string

DNS server IP address.

Port int

DNS server port.

ipAddress String

DNS server IP address.

port Integer

DNS server port.

ipAddress string

DNS server IP address.

port number

DNS server port.

ip_address str

DNS server IP address.

port int

DNS server port.

ipAddress String

DNS server IP address.

port Number

DNS server port.

TargetDnsServerResponse

IpAddress string

DNS server IP address.

Port int

DNS server port.

IpAddress string

DNS server IP address.

Port int

DNS server port.

ipAddress String

DNS server IP address.

port Integer

DNS server port.

ipAddress string

DNS server IP address.

port number

DNS server port.

ip_address str

DNS server IP address.

port int

DNS server port.

ipAddress String

DNS server IP address.

port Number

DNS server port.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:network:ForwardingRule sampleForwardingRule /subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset/forwardingRules/sampleForwardingRule 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0