NamespaceNetworkRuleSet

class NamespaceNetworkRuleSet : KotlinCustomResource

Manages a ServiceBus Namespace Network Rule Set.

The azure.servicebus.NamespaceNetworkRuleSet resource is deprecated and will be removed in version 4.0 of the AzureRM provider. Please use network_rule_set inside the azure.servicebus.Namespace resource instead.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleNamespace = new azure.servicebus.Namespace("example", {
name: "example-sb-namespace",
location: example.location,
resourceGroupName: example.name,
sku: "Premium",
capacity: 1,
});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
name: "example-vnet",
location: example.location,
resourceGroupName: example.name,
addressSpaces: ["172.17.0.0/16"],
dnsServers: [
"10.0.0.4",
"10.0.0.5",
],
});
const exampleSubnet = new azure.network.Subnet("example", {
name: "default",
resourceGroupName: example.name,
virtualNetworkName: exampleVirtualNetwork.name,
addressPrefixes: ["172.17.0.0/24"],
serviceEndpoints: ["Microsoft.ServiceBus"],
});
const exampleNamespaceNetworkRuleSet = new azure.servicebus.NamespaceNetworkRuleSet("example", {
namespaceId: exampleNamespace.id,
defaultAction: "Deny",
publicNetworkAccessEnabled: true,
networkRules: [{
subnetId: exampleSubnet.id,
ignoreMissingVnetServiceEndpoint: false,
}],
ipRules: ["1.1.1.1"],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_namespace = azure.servicebus.Namespace("example",
name="example-sb-namespace",
location=example.location,
resource_group_name=example.name,
sku="Premium",
capacity=1)
example_virtual_network = azure.network.VirtualNetwork("example",
name="example-vnet",
location=example.location,
resource_group_name=example.name,
address_spaces=["172.17.0.0/16"],
dns_servers=[
"10.0.0.4",
"10.0.0.5",
])
example_subnet = azure.network.Subnet("example",
name="default",
resource_group_name=example.name,
virtual_network_name=example_virtual_network.name,
address_prefixes=["172.17.0.0/24"],
service_endpoints=["Microsoft.ServiceBus"])
example_namespace_network_rule_set = azure.servicebus.NamespaceNetworkRuleSet("example",
namespace_id=example_namespace.id,
default_action="Deny",
public_network_access_enabled=True,
network_rules=[{
"subnet_id": example_subnet.id,
"ignore_missing_vnet_service_endpoint": False,
}],
ip_rules=["1.1.1.1"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleNamespace = new Azure.ServiceBus.Namespace("example", new()
{
Name = "example-sb-namespace",
Location = example.Location,
ResourceGroupName = example.Name,
Sku = "Premium",
Capacity = 1,
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
{
Name = "example-vnet",
Location = example.Location,
ResourceGroupName = example.Name,
AddressSpaces = new[]
{
"172.17.0.0/16",
},
DnsServers = new[]
{
"10.0.0.4",
"10.0.0.5",
},
});
var exampleSubnet = new Azure.Network.Subnet("example", new()
{
Name = "default",
ResourceGroupName = example.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefixes = new[]
{
"172.17.0.0/24",
},
ServiceEndpoints = new[]
{
"Microsoft.ServiceBus",
},
});
var exampleNamespaceNetworkRuleSet = new Azure.ServiceBus.NamespaceNetworkRuleSet("example", new()
{
NamespaceId = exampleNamespace.Id,
DefaultAction = "Deny",
PublicNetworkAccessEnabled = true,
NetworkRules = new[]
{
new Azure.ServiceBus.Inputs.NamespaceNetworkRuleSetNetworkRuleArgs
{
SubnetId = exampleSubnet.Id,
IgnoreMissingVnetServiceEndpoint = false,
},
},
IpRules = new[]
{
"1.1.1.1",
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleNamespace, err := servicebus.NewNamespace(ctx, "example", &servicebus.NamespaceArgs{
Name: pulumi.String("example-sb-namespace"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: pulumi.String("Premium"),
Capacity: pulumi.Int(1),
})
if err != nil {
return err
}
exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
Name: pulumi.String("example-vnet"),
Location: example.Location,
ResourceGroupName: example.Name,
AddressSpaces: pulumi.StringArray{
pulumi.String("172.17.0.0/16"),
},
DnsServers: pulumi.StringArray{
pulumi.String("10.0.0.4"),
pulumi.String("10.0.0.5"),
},
})
if err != nil {
return err
}
exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
Name: pulumi.String("default"),
ResourceGroupName: example.Name,
VirtualNetworkName: exampleVirtualNetwork.Name,
AddressPrefixes: pulumi.StringArray{
pulumi.String("172.17.0.0/24"),
},
ServiceEndpoints: pulumi.StringArray{
pulumi.String("Microsoft.ServiceBus"),
},
})
if err != nil {
return err
}
_, err = servicebus.NewNamespaceNetworkRuleSet(ctx, "example", &servicebus.NamespaceNetworkRuleSetArgs{
NamespaceId: exampleNamespace.ID(),
DefaultAction: pulumi.String("Deny"),
PublicNetworkAccessEnabled: pulumi.Bool(true),
NetworkRules: servicebus.NamespaceNetworkRuleSetNetworkRuleArray{
&servicebus.NamespaceNetworkRuleSetNetworkRuleArgs{
SubnetId: exampleSubnet.ID(),
IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
},
},
IpRules: pulumi.StringArray{
pulumi.String("1.1.1.1"),
},
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.servicebus.Namespace;
import com.pulumi.azure.servicebus.NamespaceArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.servicebus.NamespaceNetworkRuleSet;
import com.pulumi.azure.servicebus.NamespaceNetworkRuleSetArgs;
import com.pulumi.azure.servicebus.inputs.NamespaceNetworkRuleSetNetworkRuleArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleNamespace = new Namespace("exampleNamespace", NamespaceArgs.builder()
.name("example-sb-namespace")
.location(example.location())
.resourceGroupName(example.name())
.sku("Premium")
.capacity(1)
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.name("example-vnet")
.location(example.location())
.resourceGroupName(example.name())
.addressSpaces("172.17.0.0/16")
.dnsServers(
"10.0.0.4",
"10.0.0.5")
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.name("default")
.resourceGroupName(example.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("172.17.0.0/24")
.serviceEndpoints("Microsoft.ServiceBus")
.build());
var exampleNamespaceNetworkRuleSet = new NamespaceNetworkRuleSet("exampleNamespaceNetworkRuleSet", NamespaceNetworkRuleSetArgs.builder()
.namespaceId(exampleNamespace.id())
.defaultAction("Deny")
.publicNetworkAccessEnabled(true)
.networkRules(NamespaceNetworkRuleSetNetworkRuleArgs.builder()
.subnetId(exampleSubnet.id())
.ignoreMissingVnetServiceEndpoint(false)
.build())
.ipRules("1.1.1.1")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleNamespace:
type: azure:servicebus:Namespace
name: example
properties:
name: example-sb-namespace
location: ${example.location}
resourceGroupName: ${example.name}
sku: Premium
capacity: 1
exampleVirtualNetwork:
type: azure:network:VirtualNetwork
name: example
properties:
name: example-vnet
location: ${example.location}
resourceGroupName: ${example.name}
addressSpaces:
- 172.17.0.0/16
dnsServers:
- 10.0.0.4
- 10.0.0.5
exampleSubnet:
type: azure:network:Subnet
name: example
properties:
name: default
resourceGroupName: ${example.name}
virtualNetworkName: ${exampleVirtualNetwork.name}
addressPrefixes:
- 172.17.0.0/24
serviceEndpoints:
- Microsoft.ServiceBus
exampleNamespaceNetworkRuleSet:
type: azure:servicebus:NamespaceNetworkRuleSet
name: example
properties:
namespaceId: ${exampleNamespace.id}
defaultAction: Deny
publicNetworkAccessEnabled: true
networkRules:
- subnetId: ${exampleSubnet.id}
ignoreMissingVnetServiceEndpoint: false
ipRules:
- 1.1.1.1

Import

Service Bus Namespace can be imported using the resource id, e.g.

$ pulumi import azure:servicebus/namespaceNetworkRuleSet:NamespaceNetworkRuleSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ServiceBus/namespaces/sbns1

Properties

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

Specifies the default action for the ServiceBus Namespace Network Rule Set. Possible values are Allow and Deny. Defaults to Allow.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val ipRules: Output<List<String>>?

One or more IP Addresses, or CIDR Blocks which should be able to access the ServiceBus Namespace.

Link copied to clipboard
val namespaceId: Output<String>

Specifies the ServiceBus Namespace ID to which to attach the ServiceBus Namespace Network Rule Set. Changing this forces a new resource to be created.

Link copied to clipboard

One or more network_rules blocks as defined below.

Link copied to clipboard

Whether to allow traffic over public network. Possible values are true and false. Defaults to true.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

If True, then Azure Services that are known and trusted for this resource type are allowed to bypass firewall configuration. See Trusted Microsoft Services

Link copied to clipboard
val urn: Output<String>