azure-native.network.ForwardingRule
Explore with Pulumi AI
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 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 = "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"
"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.TargetDnsServerArgs{
{
IpAddress: pulumi.String("10.0.0.1"),
Port: pulumi.Int(53),
},
{
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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ForwardingRule(name: string, args: ForwardingRuleArgs, opts?: CustomResourceOptions);
@overload
def ForwardingRule(resource_name: str,
args: ForwardingRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ForwardingRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
dns_forwarding_ruleset_name: Optional[str] = None,
domain_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
target_dns_servers: Optional[Sequence[TargetDnsServerArgs]] = None,
forwarding_rule_name: Optional[str] = None,
forwarding_rule_state: Optional[Union[str, ForwardingRuleState]] = None,
metadata: Optional[Mapping[str, str]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var forwardingRuleResource = new AzureNative.Network.ForwardingRule("forwardingRuleResource", new()
{
DnsForwardingRulesetName = "string",
DomainName = "string",
ResourceGroupName = "string",
TargetDnsServers = new[]
{
{
{ "ipAddress", "string" },
{ "port", 0 },
},
},
ForwardingRuleName = "string",
ForwardingRuleState = "string",
Metadata =
{
{ "string", "string" },
},
});
example, err := network.NewForwardingRule(ctx, "forwardingRuleResource", &network.ForwardingRuleArgs{
DnsForwardingRulesetName: "string",
DomainName: "string",
ResourceGroupName: "string",
TargetDnsServers: []map[string]interface{}{
map[string]interface{}{
"ipAddress": "string",
"port": 0,
},
},
ForwardingRuleName: "string",
ForwardingRuleState: "string",
Metadata: map[string]interface{}{
"string": "string",
},
})
var forwardingRuleResource = new ForwardingRule("forwardingRuleResource", ForwardingRuleArgs.builder()
.dnsForwardingRulesetName("string")
.domainName("string")
.resourceGroupName("string")
.targetDnsServers(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.forwardingRuleName("string")
.forwardingRuleState("string")
.metadata(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
forwarding_rule_resource = azure_native.network.ForwardingRule("forwardingRuleResource",
dns_forwarding_ruleset_name=string,
domain_name=string,
resource_group_name=string,
target_dns_servers=[{
ipAddress: string,
port: 0,
}],
forwarding_rule_name=string,
forwarding_rule_state=string,
metadata={
string: string,
})
const forwardingRuleResource = new azure_native.network.ForwardingRule("forwardingRuleResource", {
dnsForwardingRulesetName: "string",
domainName: "string",
resourceGroupName: "string",
targetDnsServers: [{
ipAddress: "string",
port: 0,
}],
forwardingRuleName: "string",
forwardingRuleState: "string",
metadata: {
string: "string",
},
});
type: azure-native:network:ForwardingRule
properties:
dnsForwardingRulesetName: string
domainName: string
forwardingRuleName: string
forwardingRuleState: string
metadata:
string: string
resourceGroupName: string
targetDnsServers:
- ipAddress: string
port: 0
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ForwardingRule resource accepts the following input properties:
- Dns
Forwarding stringRuleset Name - The name of the DNS forwarding ruleset.
- Domain
Name string - The domain name for the forwarding rule.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Target
Dns List<Pulumi.Servers Azure Native. Network. Inputs. Target Dns Server> - DNS servers to forward the DNS query to.
- Forwarding
Rule stringName - The name of the forwarding rule.
- Forwarding
Rule string | Pulumi.State Azure Native. Network. Forwarding Rule State - The state of forwarding rule.
- Metadata Dictionary<string, string>
- Metadata attached to the forwarding rule.
- Dns
Forwarding stringRuleset Name - The name of the DNS forwarding ruleset.
- Domain
Name string - The domain name for the forwarding rule.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Target
Dns []TargetServers Dns Server Args - DNS servers to forward the DNS query to.
- Forwarding
Rule stringName - The name of the forwarding rule.
- Forwarding
Rule string | ForwardingState Rule State Enum - The state of forwarding rule.
- Metadata map[string]string
- Metadata attached to the forwarding rule.
- dns
Forwarding StringRuleset Name - The name of the DNS forwarding ruleset.
- domain
Name String - The domain name for the forwarding rule.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- target
Dns List<TargetServers Dns Server> - DNS servers to forward the DNS query to.
- forwarding
Rule StringName - The name of the forwarding rule.
- forwarding
Rule String | ForwardingState Rule State - The state of forwarding rule.
- metadata Map<String,String>
- Metadata attached to the forwarding rule.
- dns
Forwarding stringRuleset Name - The name of the DNS forwarding ruleset.
- domain
Name string - The domain name for the forwarding rule.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- target
Dns TargetServers Dns Server[] - DNS servers to forward the DNS query to.
- forwarding
Rule stringName - The name of the forwarding rule.
- forwarding
Rule string | ForwardingState Rule State - The state of forwarding rule.
- metadata {[key: string]: string}
- Metadata attached to the forwarding rule.
- dns_
forwarding_ strruleset_ name - The name of the DNS forwarding ruleset.
- domain_
name str - The domain name for the forwarding rule.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- target_
dns_ Sequence[Targetservers Dns Server Args] - DNS servers to forward the DNS query to.
- forwarding_
rule_ strname - The name of the forwarding rule.
- forwarding_
rule_ str | Forwardingstate Rule State - The state of forwarding rule.
- metadata Mapping[str, str]
- Metadata attached to the forwarding rule.
- dns
Forwarding StringRuleset Name - The name of the DNS forwarding ruleset.
- domain
Name String - The domain name for the forwarding rule.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- target
Dns List<Property Map>Servers - DNS servers to forward the DNS query to.
- forwarding
Rule StringName - The name of the forwarding rule.
- forwarding
Rule String | "Enabled" | "Disabled"State - 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
- Provisioning
State 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.
- System
Data Pulumi.Azure Native. Network. Outputs. System Data Response - 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
- Provisioning
State 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.
- System
Data SystemData Response - 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
- provisioning
State 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.
- system
Data SystemData Response - 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
- provisioning
State 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.
- system
Data SystemData Response - 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 SystemData Response - 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
- provisioning
State 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.
- system
Data 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, ForwardingRuleStateArgs
- Enabled
- Enabled
- Disabled
- Disabled
- Forwarding
Rule State Enabled - Enabled
- Forwarding
Rule State Disabled - Disabled
- Enabled
- Enabled
- Disabled
- Disabled
- Enabled
- Enabled
- Disabled
- Disabled
- ENABLED
- Enabled
- DISABLED
- Disabled
- "Enabled"
- Enabled
- "Disabled"
- Disabled
SystemDataResponse, SystemDataResponseArgs
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The type of identity that last modified the resource.
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The type of identity that last modified the resource.
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The type of identity that last modified the resource.
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The type of identity that last modified the resource.
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - 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_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The type of identity that last modified the resource.
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The type of identity that last modified the resource.
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
TargetDnsServer, TargetDnsServerArgs
- ip_
address str - DNS server IP address.
- port int
- DNS server port.
TargetDnsServerResponse, TargetDnsServerResponseArgs
- ip_
address str - DNS server IP address.
- port int
- 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0