Routing Rule Args
Network routing rule. Uses Azure REST API version 2024-05-01. In version 2.x of the Azure Native provider, it used API version 2024-03-01. Other available API versions: 2024-03-01, 2024-07-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native network [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
Example Usage
Create a default routing rule
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var routingRule = new AzureNative.Network.RoutingRule("routingRule", new()
{
ConfigurationName = "myTestRoutingConfig",
Description = "This is Sample Routing Rule",
Destination = new AzureNative.Network.Inputs.RoutingRuleRouteDestinationArgs
{
DestinationAddress = "10.0.0.0/16",
Type = AzureNative.Network.RoutingRuleDestinationType.AddressPrefix,
},
NetworkManagerName = "testNetworkManager",
NextHop = new AzureNative.Network.Inputs.RoutingRuleNextHopArgs
{
NextHopType = AzureNative.Network.RoutingRuleNextHopType.VirtualNetworkGateway,
},
ResourceGroupName = "rg1",
RuleCollectionName = "testRuleCollection",
RuleName = "SampleRoutingRule",
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewRoutingRule(ctx, "routingRule", &network.RoutingRuleArgs{
ConfigurationName: pulumi.String("myTestRoutingConfig"),
Description: pulumi.String("This is Sample Routing Rule"),
Destination: &network.RoutingRuleRouteDestinationArgs{
DestinationAddress: pulumi.String("10.0.0.0/16"),
Type: pulumi.String(network.RoutingRuleDestinationTypeAddressPrefix),
},
NetworkManagerName: pulumi.String("testNetworkManager"),
NextHop: &network.RoutingRuleNextHopArgs{
NextHopType: pulumi.String(network.RoutingRuleNextHopTypeVirtualNetworkGateway),
},
ResourceGroupName: pulumi.String("rg1"),
RuleCollectionName: pulumi.String("testRuleCollection"),
RuleName: pulumi.String("SampleRoutingRule"),
})
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.RoutingRule;
import com.pulumi.azurenative.network.RoutingRuleArgs;
import com.pulumi.azurenative.network.inputs.RoutingRuleRouteDestinationArgs;
import com.pulumi.azurenative.network.inputs.RoutingRuleNextHopArgs;
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 routingRule = new RoutingRule("routingRule", RoutingRuleArgs.builder()
.configurationName("myTestRoutingConfig")
.description("This is Sample Routing Rule")
.destination(RoutingRuleRouteDestinationArgs.builder()
.destinationAddress("10.0.0.0/16")
.type("AddressPrefix")
.build())
.networkManagerName("testNetworkManager")
.nextHop(RoutingRuleNextHopArgs.builder()
.nextHopType("VirtualNetworkGateway")
.build())
.resourceGroupName("rg1")
.ruleCollectionName("testRuleCollection")
.ruleName("SampleRoutingRule")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:RoutingRule SampleRoutingRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}
Constructors
Properties
The name of the network manager Routing Configuration.
A description for this rule.
Indicates the destination for this particular rule.
The name of the network manager.
Indicates the next hop for this particular rule.
The name of the resource group. The name is case insensitive.
The name of the network manager routing Configuration rule collection.