RoutingRule

class RoutingRule : KotlinCustomResource

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. 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/v2"
"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}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val description: Output<String>?

A description for this rule.

Link copied to clipboard

Indicates the destination for this particular rule.

Link copied to clipboard
val etag: Output<String>

A unique read-only string that changes whenever the resource is updated.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard

Indicates the next hop for this particular rule.

Link copied to clipboard

The provisioning state of the resource.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGuid: Output<String>

Unique identifier for this resource.

Link copied to clipboard

The system metadata related to this resource.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>