ForwardingRule

class ForwardingRule : KotlinCustomResource

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,
},
},
});
});
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
})
}
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());
}
}

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}

Properties

Link copied to clipboard
val domainName: Output<String>

The domain name for the forwarding rule.

Link copied to clipboard
val etag: Output<String>

ETag of the forwarding rule.

Link copied to clipboard

The state of forwarding rule.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val metadata: Output<Map<String, String>>?

Metadata attached to the forwarding rule.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Metadata pertaining to creation and last modification of the resource.

Link copied to clipboard

DNS servers to forward the DNS query to.

Link copied to clipboard
val type: Output<String>

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

Link copied to clipboard
val urn: Output<String>