Namespace Network Rule Set Args
data class NamespaceNetworkRuleSetArgs(val defaultAction: Output<Either<String, DefaultAction>>? = null, val ipRules: Output<List<NWRuleSetIpRulesArgs>>? = null, val namespaceName: Output<String>? = null, val publicNetworkAccess: Output<Either<String, PublicNetworkAccessFlag>>? = null, val resourceGroupName: Output<String>? = null, val trustedServiceAccessEnabled: Output<Boolean>? = null, val virtualNetworkRules: Output<List<NWRuleSetVirtualNetworkRulesArgs>>? = null) : ConvertibleToJava<NamespaceNetworkRuleSetArgs>
Description of NetworkRuleSet resource. Uses Azure REST API version 2022-01-01-preview. In version 1.x of the Azure Native provider, it used API version 2017-04-01. Other available API versions: 2022-10-01-preview, 2023-01-01-preview, 2024-01-01.
Example Usage
NameSpaceNetworkRuleSetCreate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var namespaceNetworkRuleSet = new AzureNative.ServiceBus.NamespaceNetworkRuleSet("namespaceNetworkRuleSet", new()
{
DefaultAction = AzureNative.ServiceBus.DefaultAction.Deny,
IpRules = new[]
{
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = AzureNative.ServiceBus.NetworkRuleIPAction.Allow,
IpMask = "1.1.1.1",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = AzureNative.ServiceBus.NetworkRuleIPAction.Allow,
IpMask = "1.1.1.2",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = AzureNative.ServiceBus.NetworkRuleIPAction.Allow,
IpMask = "1.1.1.3",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = AzureNative.ServiceBus.NetworkRuleIPAction.Allow,
IpMask = "1.1.1.4",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = AzureNative.ServiceBus.NetworkRuleIPAction.Allow,
IpMask = "1.1.1.5",
},
},
NamespaceName = "sdk-Namespace-6019",
ResourceGroupName = "ResourceGroup",
VirtualNetworkRules = new[]
{
new AzureNative.ServiceBus.Inputs.NWRuleSetVirtualNetworkRulesArgs
{
IgnoreMissingVnetServiceEndpoint = true,
Subnet = new AzureNative.ServiceBus.Inputs.SubnetArgs
{
Id = "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2",
},
},
new AzureNative.ServiceBus.Inputs.NWRuleSetVirtualNetworkRulesArgs
{
IgnoreMissingVnetServiceEndpoint = false,
Subnet = new AzureNative.ServiceBus.Inputs.SubnetArgs
{
Id = "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3",
},
},
new AzureNative.ServiceBus.Inputs.NWRuleSetVirtualNetworkRulesArgs
{
IgnoreMissingVnetServiceEndpoint = false,
Subnet = new AzureNative.ServiceBus.Inputs.SubnetArgs
{
Id = "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6",
},
},
},
});
});
Content copied to clipboard
package main
import (
servicebus "github.com/pulumi/pulumi-azure-native-sdk/servicebus/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := servicebus.NewNamespaceNetworkRuleSet(ctx, "namespaceNetworkRuleSet", &servicebus.NamespaceNetworkRuleSetArgs{
DefaultAction: pulumi.String(servicebus.DefaultActionDeny),
IpRules: servicebus.NWRuleSetIpRulesArray{
&servicebus.NWRuleSetIpRulesArgs{
Action: pulumi.String(servicebus.NetworkRuleIPActionAllow),
IpMask: pulumi.String("1.1.1.1"),
},
&servicebus.NWRuleSetIpRulesArgs{
Action: pulumi.String(servicebus.NetworkRuleIPActionAllow),
IpMask: pulumi.String("1.1.1.2"),
},
&servicebus.NWRuleSetIpRulesArgs{
Action: pulumi.String(servicebus.NetworkRuleIPActionAllow),
IpMask: pulumi.String("1.1.1.3"),
},
&servicebus.NWRuleSetIpRulesArgs{
Action: pulumi.String(servicebus.NetworkRuleIPActionAllow),
IpMask: pulumi.String("1.1.1.4"),
},
&servicebus.NWRuleSetIpRulesArgs{
Action: pulumi.String(servicebus.NetworkRuleIPActionAllow),
IpMask: pulumi.String("1.1.1.5"),
},
},
NamespaceName: pulumi.String("sdk-Namespace-6019"),
ResourceGroupName: pulumi.String("ResourceGroup"),
VirtualNetworkRules: servicebus.NWRuleSetVirtualNetworkRulesArray{
&servicebus.NWRuleSetVirtualNetworkRulesArgs{
IgnoreMissingVnetServiceEndpoint: pulumi.Bool(true),
Subnet: &servicebus.SubnetArgs{
Id: pulumi.String("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"),
},
},
&servicebus.NWRuleSetVirtualNetworkRulesArgs{
IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
Subnet: &servicebus.SubnetArgs{
Id: pulumi.String("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"),
},
},
&servicebus.NWRuleSetVirtualNetworkRulesArgs{
IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
Subnet: &servicebus.SubnetArgs{
Id: pulumi.String("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.servicebus.NamespaceNetworkRuleSet;
import com.pulumi.azurenative.servicebus.NamespaceNetworkRuleSetArgs;
import com.pulumi.azurenative.servicebus.inputs.NWRuleSetIpRulesArgs;
import com.pulumi.azurenative.servicebus.inputs.NWRuleSetVirtualNetworkRulesArgs;
import com.pulumi.azurenative.servicebus.inputs.SubnetArgs;
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 namespaceNetworkRuleSet = new NamespaceNetworkRuleSet("namespaceNetworkRuleSet", NamespaceNetworkRuleSetArgs.builder()
.defaultAction("Deny")
.ipRules(
NWRuleSetIpRulesArgs.builder()
.action("Allow")
.ipMask("1.1.1.1")
.build(),
NWRuleSetIpRulesArgs.builder()
.action("Allow")
.ipMask("1.1.1.2")
.build(),
NWRuleSetIpRulesArgs.builder()
.action("Allow")
.ipMask("1.1.1.3")
.build(),
NWRuleSetIpRulesArgs.builder()
.action("Allow")
.ipMask("1.1.1.4")
.build(),
NWRuleSetIpRulesArgs.builder()
.action("Allow")
.ipMask("1.1.1.5")
.build())
.namespaceName("sdk-Namespace-6019")
.resourceGroupName("ResourceGroup")
.virtualNetworkRules(
NWRuleSetVirtualNetworkRulesArgs.builder()
.ignoreMissingVnetServiceEndpoint(true)
.subnet(SubnetArgs.builder()
.id("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2")
.build())
.build(),
NWRuleSetVirtualNetworkRulesArgs.builder()
.ignoreMissingVnetServiceEndpoint(false)
.subnet(SubnetArgs.builder()
.id("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3")
.build())
.build(),
NWRuleSetVirtualNetworkRulesArgs.builder()
.ignoreMissingVnetServiceEndpoint(false)
.subnet(SubnetArgs.builder()
.id("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6")
.build())
.build())
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:servicebus:NamespaceNetworkRuleSet default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(defaultAction: Output<Either<String, DefaultAction>>? = null, ipRules: Output<List<NWRuleSetIpRulesArgs>>? = null, namespaceName: Output<String>? = null, publicNetworkAccess: Output<Either<String, PublicNetworkAccessFlag>>? = null, resourceGroupName: Output<String>? = null, trustedServiceAccessEnabled: Output<Boolean>? = null, virtualNetworkRules: Output<List<NWRuleSetVirtualNetworkRulesArgs>>? = null)
Properties
Link copied to clipboard
Default Action for Network Rule Set
Link copied to clipboard
List of IpRules
Link copied to clipboard
The namespace name
Link copied to clipboard
This determines if traffic is allowed over public network. By default it is enabled.
Link copied to clipboard
Name of the Resource group within the Azure subscription.
Link copied to clipboard
Value that indicates whether Trusted Service Access is Enabled or not.
Link copied to clipboard
List VirtualNetwork Rules