Forwarding Rule Args
data class ForwardingRuleArgs(val dnsForwardingRulesetName: Output<String>? = null, val domainName: Output<String>? = null, val forwardingRuleName: Output<String>? = null, val forwardingRuleState: Output<Either<String, ForwardingRuleState>>? = null, val metadata: Output<Map<String, String>>? = null, val resourceGroupName: Output<String>? = null, val targetDnsServers: Output<List<TargetDnsServerArgs>>? = null) : ConvertibleToJava<ForwardingRuleArgs>
Describes a forwarding rule within a DNS forwarding ruleset. Uses Azure REST API version 2022-07-01. In version 1.x of the Azure Native provider, it used API version 2020-04-01-preview. Other available API versions: 2023-07-01-preview.
Example Usage
Upsert forwarding rule in a DNS forwarding ruleset
using System.Collections.Generic;
using System.Linq;
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 = AzureNative.Network.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,
},
},
});
});
Content copied to clipboard
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
"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(network.ForwardingRuleStateEnabled),
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
})
}
Content copied to clipboard
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 com.pulumi.azurenative.network.inputs.TargetDnsServerArgs;
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(
TargetDnsServerArgs.builder()
.ipAddress("10.0.0.1")
.port(53)
.build(),
TargetDnsServerArgs.builder()
.ipAddress("10.0.0.2")
.port(53)
.build())
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:ForwardingRule sampleForwardingRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(dnsForwardingRulesetName: Output<String>? = null, domainName: Output<String>? = null, forwardingRuleName: Output<String>? = null, forwardingRuleState: Output<Either<String, ForwardingRuleState>>? = null, metadata: Output<Map<String, String>>? = null, resourceGroupName: Output<String>? = null, targetDnsServers: Output<List<TargetDnsServerArgs>>? = null)
Properties
Link copied to clipboard
The name of the DNS forwarding ruleset.
Link copied to clipboard
The domain name for the forwarding rule.
Link copied to clipboard
The name of the forwarding rule.
Link copied to clipboard
The state of forwarding rule.
Link copied to clipboard
The name of the resource group. The name is case insensitive.
Link copied to clipboard
DNS servers to forward the DNS query to.