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 resourceGroupName: Output<String>? = null, val virtualNetworkRules: Output<List<NWRuleSetVirtualNetworkRulesArgs>>? = null) : ConvertibleToJava<NamespaceNetworkRuleSetArgs>
Description of NetworkRuleSet resource. API Version: 2017-04-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 = "Deny",
IpRules = new[]
{
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = "Allow",
IpMask = "1.1.1.1",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = "Allow",
IpMask = "1.1.1.2",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = "Allow",
IpMask = "1.1.1.3",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = "Allow",
IpMask = "1.1.1.4",
},
new AzureNative.ServiceBus.Inputs.NWRuleSetIpRulesArgs
{
Action = "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/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2",
},
},
new AzureNative.ServiceBus.Inputs.NWRuleSetVirtualNetworkRulesArgs
{
IgnoreMissingVnetServiceEndpoint = false,
Subnet = new AzureNative.ServiceBus.Inputs.SubnetArgs
{
Id = "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3",
},
},
new AzureNative.ServiceBus.Inputs.NWRuleSetVirtualNetworkRulesArgs
{
IgnoreMissingVnetServiceEndpoint = false,
Subnet = new AzureNative.ServiceBus.Inputs.SubnetArgs
{
Id = "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6",
},
},
},
});
});
Content copied to clipboard
package main
import (
servicebus "github.com/pulumi/pulumi-azure-native-sdk/servicebus"
"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("Deny"),
IpRules: []servicebus.NWRuleSetIpRulesArgs{
{
Action: pulumi.String("Allow"),
IpMask: pulumi.String("1.1.1.1"),
},
{
Action: pulumi.String("Allow"),
IpMask: pulumi.String("1.1.1.2"),
},
{
Action: pulumi.String("Allow"),
IpMask: pulumi.String("1.1.1.3"),
},
{
Action: pulumi.String("Allow"),
IpMask: pulumi.String("1.1.1.4"),
},
{
Action: pulumi.String("Allow"),
IpMask: pulumi.String("1.1.1.5"),
},
},
NamespaceName: pulumi.String("sdk-Namespace-6019"),
ResourceGroupName: pulumi.String("ResourceGroup"),
VirtualNetworkRules: []servicebus.NWRuleSetVirtualNetworkRulesArgs{
{
IgnoreMissingVnetServiceEndpoint: pulumi.Bool(true),
Subnet: {
Id: pulumi.String("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"),
},
},
{
IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
Subnet: {
Id: pulumi.String("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"),
},
},
{
IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
Subnet: {
Id: pulumi.String("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/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 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(
Map.ofEntries(
Map.entry("action", "Allow"),
Map.entry("ipMask", "1.1.1.1")
),
Map.ofEntries(
Map.entry("action", "Allow"),
Map.entry("ipMask", "1.1.1.2")
),
Map.ofEntries(
Map.entry("action", "Allow"),
Map.entry("ipMask", "1.1.1.3")
),
Map.ofEntries(
Map.entry("action", "Allow"),
Map.entry("ipMask", "1.1.1.4")
),
Map.ofEntries(
Map.entry("action", "Allow"),
Map.entry("ipMask", "1.1.1.5")
))
.namespaceName("sdk-Namespace-6019")
.resourceGroupName("ResourceGroup")
.virtualNetworkRules(
Map.ofEntries(
Map.entry("ignoreMissingVnetServiceEndpoint", true),
Map.entry("subnet", Map.of("id", "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"))
),
Map.ofEntries(
Map.entry("ignoreMissingVnetServiceEndpoint", false),
Map.entry("subnet", Map.of("id", "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"))
),
Map.ofEntries(
Map.entry("ignoreMissingVnetServiceEndpoint", false),
Map.entry("subnet", Map.of("id", "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"))
))
.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/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourceGroups/resourcegroupid/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9659/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, resourceGroupName: Output<String>? = null, virtualNetworkRules: Output<List<NWRuleSetVirtualNetworkRulesArgs>>? = null)