RoutePolicy

class RoutePolicy : KotlinCustomResource

The RoutePolicy resource definition. Uses Azure REST API version 2023-06-15. In version 2.x of the Azure Native provider, it used API version 2023-02-01-preview. Other available API versions: 2023-02-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native managednetworkfabric [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

RoutePolicies_Create_MaximumSet_Gen

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var routePolicy = new AzureNative.ManagedNetworkFabric.RoutePolicy("routePolicy", new()
{
AddressFamilyType = AzureNative.ManagedNetworkFabric.AddressFamilyType.IPv4,
Annotation = "annotation",
DefaultAction = AzureNative.ManagedNetworkFabric.CommunityActionTypes.Deny,
Location = "eastus",
NetworkFabricId = "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric",
ResourceGroupName = "example-rg",
RoutePolicyName = "example-routePolicy",
Statements = new[]
{
new AzureNative.ManagedNetworkFabric.Inputs.RoutePolicyStatementPropertiesArgs
{
Action = new AzureNative.ManagedNetworkFabric.Inputs.StatementActionPropertiesArgs
{
ActionType = AzureNative.ManagedNetworkFabric.RoutePolicyActionType.Permit,
IpCommunityProperties = new AzureNative.ManagedNetworkFabric.Inputs.ActionIpCommunityPropertiesArgs
{
Add = new AzureNative.ManagedNetworkFabric.Inputs.IpCommunityIdListArgs
{
IpCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity",
},
},
Delete = new AzureNative.ManagedNetworkFabric.Inputs.IpCommunityIdListArgs
{
IpCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity",
},
},
Set = new AzureNative.ManagedNetworkFabric.Inputs.IpCommunityIdListArgs
{
IpCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity",
},
},
},
IpExtendedCommunityProperties = new AzureNative.ManagedNetworkFabric.Inputs.ActionIpExtendedCommunityPropertiesArgs
{
Add = new AzureNative.ManagedNetworkFabric.Inputs.IpExtendedCommunityIdListArgs
{
IpExtendedCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity",
},
},
Delete = new AzureNative.ManagedNetworkFabric.Inputs.IpExtendedCommunityIdListArgs
{
IpExtendedCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity",
},
},
Set = new AzureNative.ManagedNetworkFabric.Inputs.IpExtendedCommunityIdListArgs
{
IpExtendedCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity",
},
},
},
LocalPreference = 20,
},
Annotation = "annotation",
Condition = new AzureNative.ManagedNetworkFabric.Inputs.StatementConditionPropertiesArgs
{
IpCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity",
},
IpExtendedCommunityIds = new[]
{
"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity",
},
IpPrefixId = "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix",
Type = AzureNative.ManagedNetworkFabric.RoutePolicyConditionType.Or,
},
SequenceNumber = 7,
},
},
Tags =
{
{ "keyID", "keyValue" },
},
});
});
package main
import (
managednetworkfabric "github.com/pulumi/pulumi-azure-native-sdk/managednetworkfabric/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := managednetworkfabric.NewRoutePolicy(ctx, "routePolicy", &managednetworkfabric.RoutePolicyArgs{
AddressFamilyType: pulumi.String(managednetworkfabric.AddressFamilyTypeIPv4),
Annotation: pulumi.String("annotation"),
DefaultAction: pulumi.String(managednetworkfabric.CommunityActionTypesDeny),
Location: pulumi.String("eastus"),
NetworkFabricId: pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"),
ResourceGroupName: pulumi.String("example-rg"),
RoutePolicyName: pulumi.String("example-routePolicy"),
Statements: managednetworkfabric.RoutePolicyStatementPropertiesArray{
&managednetworkfabric.RoutePolicyStatementPropertiesArgs{
Action: &managednetworkfabric.StatementActionPropertiesArgs{
ActionType: pulumi.String(managednetworkfabric.RoutePolicyActionTypePermit),
IpCommunityProperties: &managednetworkfabric.ActionIpCommunityPropertiesArgs{
Add: &managednetworkfabric.IpCommunityIdListArgs{
IpCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"),
},
},
Delete: &managednetworkfabric.IpCommunityIdListArgs{
IpCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"),
},
},
Set: &managednetworkfabric.IpCommunityIdListArgs{
IpCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"),
},
},
},
IpExtendedCommunityProperties: &managednetworkfabric.ActionIpExtendedCommunityPropertiesArgs{
Add: &managednetworkfabric.IpExtendedCommunityIdListArgs{
IpExtendedCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"),
},
},
Delete: &managednetworkfabric.IpExtendedCommunityIdListArgs{
IpExtendedCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"),
},
},
Set: &managednetworkfabric.IpExtendedCommunityIdListArgs{
IpExtendedCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"),
},
},
},
LocalPreference: pulumi.Float64(20),
},
Annotation: pulumi.String("annotation"),
Condition: &managednetworkfabric.StatementConditionPropertiesArgs{
IpCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"),
},
IpExtendedCommunityIds: pulumi.StringArray{
pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"),
},
IpPrefixId: pulumi.String("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"),
Type: pulumi.String(managednetworkfabric.RoutePolicyConditionTypeOr),
},
SequenceNumber: pulumi.Float64(7),
},
},
Tags: pulumi.StringMap{
"keyID": pulumi.String("keyValue"),
},
})
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.managednetworkfabric.RoutePolicy;
import com.pulumi.azurenative.managednetworkfabric.RoutePolicyArgs;
import com.pulumi.azurenative.managednetworkfabric.inputs.RoutePolicyStatementPropertiesArgs;
import com.pulumi.azurenative.managednetworkfabric.inputs.StatementActionPropertiesArgs;
import com.pulumi.azurenative.managednetworkfabric.inputs.ActionIpCommunityPropertiesArgs;
import com.pulumi.azurenative.managednetworkfabric.inputs.IpCommunityIdListArgs;
import com.pulumi.azurenative.managednetworkfabric.inputs.ActionIpExtendedCommunityPropertiesArgs;
import com.pulumi.azurenative.managednetworkfabric.inputs.IpExtendedCommunityIdListArgs;
import com.pulumi.azurenative.managednetworkfabric.inputs.StatementConditionPropertiesArgs;
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 routePolicy = new RoutePolicy("routePolicy", RoutePolicyArgs.builder()
.addressFamilyType("IPv4")
.annotation("annotation")
.defaultAction("Deny")
.location("eastus")
.networkFabricId("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric")
.resourceGroupName("example-rg")
.routePolicyName("example-routePolicy")
.statements(RoutePolicyStatementPropertiesArgs.builder()
.action(StatementActionPropertiesArgs.builder()
.actionType("Permit")
.ipCommunityProperties(ActionIpCommunityPropertiesArgs.builder()
.add(IpCommunityIdListArgs.builder()
.ipCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")
.build())
.delete(IpCommunityIdListArgs.builder()
.ipCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")
.build())
.set(IpCommunityIdListArgs.builder()
.ipCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")
.build())
.build())
.ipExtendedCommunityProperties(ActionIpExtendedCommunityPropertiesArgs.builder()
.add(IpExtendedCommunityIdListArgs.builder()
.ipExtendedCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")
.build())
.delete(IpExtendedCommunityIdListArgs.builder()
.ipExtendedCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")
.build())
.set(IpExtendedCommunityIdListArgs.builder()
.ipExtendedCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")
.build())
.build())
.localPreference(20)
.build())
.annotation("annotation")
.condition(StatementConditionPropertiesArgs.builder()
.ipCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")
.ipExtendedCommunityIds("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")
.ipPrefixId("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix")
.type("Or")
.build())
.sequenceNumber(7)
.build())
.tags(Map.of("keyID", "keyValue"))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:managednetworkfabric:RoutePolicy example-routePolicy /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}

Properties

Link copied to clipboard

AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy.

Link copied to clipboard

Administrative state of the resource.

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

Switch configuration description.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard

Configuration state of the resource.

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

Default action that needs to be applied when no condition is matched. Example: Permit | Deny.

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

The geo-location where the resource lives

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard
val networkFabricId: Output<String>

Arm Resource ID of Network Fabric.

Link copied to clipboard

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

Route Policy statements.

Link copied to clipboard

Azure Resource Manager metadata containing createdBy and modifiedBy information.

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

Resource tags.

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>