Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.servicebus.kotlin.NamespaceNetworkRuleSetArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.servicebus.kotlin
import com.pulumi.azure.servicebus.NamespaceNetworkRuleSetArgs.builder
import com.pulumi.azure.servicebus.kotlin.inputs.NamespaceNetworkRuleSetNetworkRuleArgs
import com.pulumi.azure.servicebus.kotlin.inputs.NamespaceNetworkRuleSetNetworkRuleArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* 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
*
* ```typescript
* 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"],
* });
* ```
* ```python
* 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"])
* ```
* ```csharp
* 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",
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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.
* ```sh
* $ pulumi import azure:servicebus/namespaceNetworkRuleSet:NamespaceNetworkRuleSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ServiceBus/namespaces/sbns1
* ```
* @property defaultAction Specifies the default action for the ServiceBus Namespace Network Rule Set. Possible values are `Allow` and `Deny`. Defaults to `Allow`.
* @property ipRules One or more IP Addresses, or CIDR Blocks which should be able to access the ServiceBus Namespace.
* @property namespaceId Specifies the ServiceBus Namespace ID to which to attach the ServiceBus Namespace Network Rule Set. Changing this forces a new resource to be created.
* > **NOTE:** The ServiceBus Namespace must be `Premium` in order to attach a ServiceBus Namespace Network Rule Set.
* @property networkRules One or more `network_rules` blocks as defined below.
* @property publicNetworkAccessEnabled Whether to allow traffic over public network. Possible values are `true` and `false`. Defaults to `true`.
* @property trustedServicesAllowed If True, then Azure Services that are known and trusted for this resource type are allowed to bypass firewall configuration. See [Trusted Microsoft Services](https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/service-bus-messaging/includes/service-bus-trusted-services.md)
*/
public data class NamespaceNetworkRuleSetArgs(
public val defaultAction: Output? = null,
public val ipRules: Output>? = null,
public val namespaceId: Output? = null,
public val networkRules: Output>? = null,
public val publicNetworkAccessEnabled: Output? = null,
public val trustedServicesAllowed: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.servicebus.NamespaceNetworkRuleSetArgs =
com.pulumi.azure.servicebus.NamespaceNetworkRuleSetArgs.builder()
.defaultAction(defaultAction?.applyValue({ args0 -> args0 }))
.ipRules(ipRules?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.namespaceId(namespaceId?.applyValue({ args0 -> args0 }))
.networkRules(
networkRules?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.publicNetworkAccessEnabled(publicNetworkAccessEnabled?.applyValue({ args0 -> args0 }))
.trustedServicesAllowed(trustedServicesAllowed?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [NamespaceNetworkRuleSetArgs].
*/
@PulumiTagMarker
public class NamespaceNetworkRuleSetArgsBuilder internal constructor() {
private var defaultAction: Output? = null
private var ipRules: Output>? = null
private var namespaceId: Output? = null
private var networkRules: Output>? = null
private var publicNetworkAccessEnabled: Output? = null
private var trustedServicesAllowed: Output? = null
/**
* @param value Specifies the default action for the ServiceBus Namespace Network Rule Set. Possible values are `Allow` and `Deny`. Defaults to `Allow`.
*/
@JvmName("fchrprqhrrsvwjfg")
public suspend fun defaultAction(`value`: Output) {
this.defaultAction = value
}
/**
* @param value One or more IP Addresses, or CIDR Blocks which should be able to access the ServiceBus Namespace.
*/
@JvmName("hjpbhfhtuojxtvag")
public suspend fun ipRules(`value`: Output>) {
this.ipRules = value
}
@JvmName("dimtqruphgujyrxj")
public suspend fun ipRules(vararg values: Output) {
this.ipRules = Output.all(values.asList())
}
/**
* @param values One or more IP Addresses, or CIDR Blocks which should be able to access the ServiceBus Namespace.
*/
@JvmName("yextotrmihhwrodv")
public suspend fun ipRules(values: List>) {
this.ipRules = Output.all(values)
}
/**
* @param value Specifies the ServiceBus Namespace ID to which to attach the ServiceBus Namespace Network Rule Set. Changing this forces a new resource to be created.
* > **NOTE:** The ServiceBus Namespace must be `Premium` in order to attach a ServiceBus Namespace Network Rule Set.
*/
@JvmName("woxgkhdembislwgv")
public suspend fun namespaceId(`value`: Output) {
this.namespaceId = value
}
/**
* @param value One or more `network_rules` blocks as defined below.
*/
@JvmName("wbhegqevpukufywn")
public suspend fun networkRules(`value`: Output>) {
this.networkRules = value
}
@JvmName("gxnumlvdeqpdjeee")
public suspend fun networkRules(vararg values: Output) {
this.networkRules = Output.all(values.asList())
}
/**
* @param values One or more `network_rules` blocks as defined below.
*/
@JvmName("okooxwadbxbyrgse")
public suspend fun networkRules(values: List>) {
this.networkRules = Output.all(values)
}
/**
* @param value Whether to allow traffic over public network. Possible values are `true` and `false`. Defaults to `true`.
*/
@JvmName("ochfykqxuxoogofh")
public suspend fun publicNetworkAccessEnabled(`value`: Output) {
this.publicNetworkAccessEnabled = value
}
/**
* @param value If True, then Azure Services that are known and trusted for this resource type are allowed to bypass firewall configuration. See [Trusted Microsoft Services](https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/service-bus-messaging/includes/service-bus-trusted-services.md)
*/
@JvmName("ywmbmqidmnovxhnk")
public suspend fun trustedServicesAllowed(`value`: Output) {
this.trustedServicesAllowed = value
}
/**
* @param value Specifies the default action for the ServiceBus Namespace Network Rule Set. Possible values are `Allow` and `Deny`. Defaults to `Allow`.
*/
@JvmName("vlwwcsqudvnqienv")
public suspend fun defaultAction(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.defaultAction = mapped
}
/**
* @param value One or more IP Addresses, or CIDR Blocks which should be able to access the ServiceBus Namespace.
*/
@JvmName("nyqdgiadfmrubmgi")
public suspend fun ipRules(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipRules = mapped
}
/**
* @param values One or more IP Addresses, or CIDR Blocks which should be able to access the ServiceBus Namespace.
*/
@JvmName("rxuxhvhbngkjufwc")
public suspend fun ipRules(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.ipRules = mapped
}
/**
* @param value Specifies the ServiceBus Namespace ID to which to attach the ServiceBus Namespace Network Rule Set. Changing this forces a new resource to be created.
* > **NOTE:** The ServiceBus Namespace must be `Premium` in order to attach a ServiceBus Namespace Network Rule Set.
*/
@JvmName("jfcgmgllocdjbixa")
public suspend fun namespaceId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.namespaceId = mapped
}
/**
* @param value One or more `network_rules` blocks as defined below.
*/
@JvmName("skbioptfxicdwoim")
public suspend fun networkRules(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.networkRules = mapped
}
/**
* @param argument One or more `network_rules` blocks as defined below.
*/
@JvmName("ibyitswwfspdjuiv")
public suspend fun networkRules(argument: List Unit>) {
val toBeMapped = argument.toList().map {
NamespaceNetworkRuleSetNetworkRuleArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.networkRules = mapped
}
/**
* @param argument One or more `network_rules` blocks as defined below.
*/
@JvmName("ualqchodbsluiulf")
public suspend fun networkRules(vararg argument: suspend NamespaceNetworkRuleSetNetworkRuleArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
NamespaceNetworkRuleSetNetworkRuleArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.networkRules = mapped
}
/**
* @param argument One or more `network_rules` blocks as defined below.
*/
@JvmName("tvacsvoilvomgcit")
public suspend fun networkRules(argument: suspend NamespaceNetworkRuleSetNetworkRuleArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
NamespaceNetworkRuleSetNetworkRuleArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.networkRules = mapped
}
/**
* @param values One or more `network_rules` blocks as defined below.
*/
@JvmName("pnfpouqredbyfuhp")
public suspend fun networkRules(vararg values: NamespaceNetworkRuleSetNetworkRuleArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.networkRules = mapped
}
/**
* @param value Whether to allow traffic over public network. Possible values are `true` and `false`. Defaults to `true`.
*/
@JvmName("fytkcrugeyrufwvw")
public suspend fun publicNetworkAccessEnabled(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.publicNetworkAccessEnabled = mapped
}
/**
* @param value If True, then Azure Services that are known and trusted for this resource type are allowed to bypass firewall configuration. See [Trusted Microsoft Services](https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/service-bus-messaging/includes/service-bus-trusted-services.md)
*/
@JvmName("ieyskbmifajyffdu")
public suspend fun trustedServicesAllowed(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.trustedServicesAllowed = mapped
}
internal fun build(): NamespaceNetworkRuleSetArgs = NamespaceNetworkRuleSetArgs(
defaultAction = defaultAction,
ipRules = ipRules,
namespaceId = namespaceId,
networkRules = networkRules,
publicNetworkAccessEnabled = publicNetworkAccessEnabled,
trustedServicesAllowed = trustedServicesAllowed,
)
}