![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.servicebus.kotlin.NamespaceDisasterRecoveryConfigArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.servicebus.kotlin
import com.pulumi.azure.servicebus.NamespaceDisasterRecoveryConfigArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages a Disaster Recovery Config for a Service Bus Namespace.
* > **NOTE:** Disaster Recovery Config is a Premium SKU only capability.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "servicebus-replication",
* location: "West Europe",
* });
* const primary = new azure.servicebus.Namespace("primary", {
* name: "servicebus-primary",
* location: example.location,
* resourceGroupName: example.name,
* sku: "Premium",
* capacity: 1,
* });
* const secondary = new azure.servicebus.Namespace("secondary", {
* name: "servicebus-secondary",
* location: example.location,
* resourceGroupName: example.name,
* sku: "Premium",
* capacity: 1,
* });
* const exampleNamespaceAuthorizationRule = new azure.servicebus.NamespaceAuthorizationRule("example", {
* name: "examplerule",
* namespaceId: exampleAzurermServicebusNamespace.id,
* listen: true,
* send: true,
* manage: false,
* });
* const exampleNamespaceDisasterRecoveryConfig = new azure.servicebus.NamespaceDisasterRecoveryConfig("example", {
* name: "servicebus-alias-name",
* primaryNamespaceId: primary.id,
* partnerNamespaceId: secondary.id,
* aliasAuthorizationRuleId: exampleNamespaceAuthorizationRule.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="servicebus-replication",
* location="West Europe")
* primary = azure.servicebus.Namespace("primary",
* name="servicebus-primary",
* location=example.location,
* resource_group_name=example.name,
* sku="Premium",
* capacity=1)
* secondary = azure.servicebus.Namespace("secondary",
* name="servicebus-secondary",
* location=example.location,
* resource_group_name=example.name,
* sku="Premium",
* capacity=1)
* example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("example",
* name="examplerule",
* namespace_id=example_azurerm_servicebus_namespace["id"],
* listen=True,
* send=True,
* manage=False)
* example_namespace_disaster_recovery_config = azure.servicebus.NamespaceDisasterRecoveryConfig("example",
* name="servicebus-alias-name",
* primary_namespace_id=primary.id,
* partner_namespace_id=secondary.id,
* alias_authorization_rule_id=example_namespace_authorization_rule.id)
* ```
* ```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 = "servicebus-replication",
* Location = "West Europe",
* });
* var primary = new Azure.ServiceBus.Namespace("primary", new()
* {
* Name = "servicebus-primary",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = "Premium",
* Capacity = 1,
* });
* var secondary = new Azure.ServiceBus.Namespace("secondary", new()
* {
* Name = "servicebus-secondary",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = "Premium",
* Capacity = 1,
* });
* var exampleNamespaceAuthorizationRule = new Azure.ServiceBus.NamespaceAuthorizationRule("example", new()
* {
* Name = "examplerule",
* NamespaceId = exampleAzurermServicebusNamespace.Id,
* Listen = true,
* Send = true,
* Manage = false,
* });
* var exampleNamespaceDisasterRecoveryConfig = new Azure.ServiceBus.NamespaceDisasterRecoveryConfig("example", new()
* {
* Name = "servicebus-alias-name",
* PrimaryNamespaceId = primary.Id,
* PartnerNamespaceId = secondary.Id,
* AliasAuthorizationRuleId = exampleNamespaceAuthorizationRule.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "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("servicebus-replication"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* primary, err := servicebus.NewNamespace(ctx, "primary", &servicebus.NamespaceArgs{
* Name: pulumi.String("servicebus-primary"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: pulumi.String("Premium"),
* Capacity: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* secondary, err := servicebus.NewNamespace(ctx, "secondary", &servicebus.NamespaceArgs{
* Name: pulumi.String("servicebus-secondary"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: pulumi.String("Premium"),
* Capacity: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* exampleNamespaceAuthorizationRule, err := servicebus.NewNamespaceAuthorizationRule(ctx, "example", &servicebus.NamespaceAuthorizationRuleArgs{
* Name: pulumi.String("examplerule"),
* NamespaceId: pulumi.Any(exampleAzurermServicebusNamespace.Id),
* Listen: pulumi.Bool(true),
* Send: pulumi.Bool(true),
* Manage: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = servicebus.NewNamespaceDisasterRecoveryConfig(ctx, "example", &servicebus.NamespaceDisasterRecoveryConfigArgs{
* Name: pulumi.String("servicebus-alias-name"),
* PrimaryNamespaceId: primary.ID(),
* PartnerNamespaceId: secondary.ID(),
* AliasAuthorizationRuleId: exampleNamespaceAuthorizationRule.ID(),
* })
* 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.servicebus.NamespaceAuthorizationRule;
* import com.pulumi.azure.servicebus.NamespaceAuthorizationRuleArgs;
* import com.pulumi.azure.servicebus.NamespaceDisasterRecoveryConfig;
* import com.pulumi.azure.servicebus.NamespaceDisasterRecoveryConfigArgs;
* 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("servicebus-replication")
* .location("West Europe")
* .build());
* var primary = new Namespace("primary", NamespaceArgs.builder()
* .name("servicebus-primary")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku("Premium")
* .capacity("1")
* .build());
* var secondary = new Namespace("secondary", NamespaceArgs.builder()
* .name("servicebus-secondary")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku("Premium")
* .capacity("1")
* .build());
* var exampleNamespaceAuthorizationRule = new NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", NamespaceAuthorizationRuleArgs.builder()
* .name("examplerule")
* .namespaceId(exampleAzurermServicebusNamespace.id())
* .listen(true)
* .send(true)
* .manage(false)
* .build());
* var exampleNamespaceDisasterRecoveryConfig = new NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", NamespaceDisasterRecoveryConfigArgs.builder()
* .name("servicebus-alias-name")
* .primaryNamespaceId(primary.id())
* .partnerNamespaceId(secondary.id())
* .aliasAuthorizationRuleId(exampleNamespaceAuthorizationRule.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: servicebus-replication
* location: West Europe
* primary:
* type: azure:servicebus:Namespace
* properties:
* name: servicebus-primary
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku: Premium
* capacity: '1'
* secondary:
* type: azure:servicebus:Namespace
* properties:
* name: servicebus-secondary
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku: Premium
* capacity: '1'
* exampleNamespaceAuthorizationRule:
* type: azure:servicebus:NamespaceAuthorizationRule
* name: example
* properties:
* name: examplerule
* namespaceId: ${exampleAzurermServicebusNamespace.id}
* listen: true
* send: true
* manage: false
* exampleNamespaceDisasterRecoveryConfig:
* type: azure:servicebus:NamespaceDisasterRecoveryConfig
* name: example
* properties:
* name: servicebus-alias-name
* primaryNamespaceId: ${primary.id}
* partnerNamespaceId: ${secondary.id}
* aliasAuthorizationRuleId: ${exampleNamespaceAuthorizationRule.id}
* ```
*
* ## Import
* Service Bus DR configs can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:servicebus/namespaceDisasterRecoveryConfig:NamespaceDisasterRecoveryConfig config1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ServiceBus/namespaces/namespace1/disasterRecoveryConfigs/config1
* ```
* @property aliasAuthorizationRuleId The Shared access policies used to access the connection string for the alias.
* @property name Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
* @property partnerNamespaceId The ID of the Service Bus Namespace to replicate to.
* @property primaryNamespaceId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
*/
public data class NamespaceDisasterRecoveryConfigArgs(
public val aliasAuthorizationRuleId: Output? = null,
public val name: Output? = null,
public val partnerNamespaceId: Output? = null,
public val primaryNamespaceId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.servicebus.NamespaceDisasterRecoveryConfigArgs =
com.pulumi.azure.servicebus.NamespaceDisasterRecoveryConfigArgs.builder()
.aliasAuthorizationRuleId(aliasAuthorizationRuleId?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.partnerNamespaceId(partnerNamespaceId?.applyValue({ args0 -> args0 }))
.primaryNamespaceId(primaryNamespaceId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [NamespaceDisasterRecoveryConfigArgs].
*/
@PulumiTagMarker
public class NamespaceDisasterRecoveryConfigArgsBuilder internal constructor() {
private var aliasAuthorizationRuleId: Output? = null
private var name: Output? = null
private var partnerNamespaceId: Output? = null
private var primaryNamespaceId: Output? = null
/**
* @param value The Shared access policies used to access the connection string for the alias.
*/
@JvmName("upqmrowdachgeejp")
public suspend fun aliasAuthorizationRuleId(`value`: Output) {
this.aliasAuthorizationRuleId = value
}
/**
* @param value Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
*/
@JvmName("hidekoetarriredy")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The ID of the Service Bus Namespace to replicate to.
*/
@JvmName("gmvywuxqbnlgxksc")
public suspend fun partnerNamespaceId(`value`: Output) {
this.partnerNamespaceId = value
}
/**
* @param value The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
*/
@JvmName("ciimhtjmrtplrjwv")
public suspend fun primaryNamespaceId(`value`: Output) {
this.primaryNamespaceId = value
}
/**
* @param value The Shared access policies used to access the connection string for the alias.
*/
@JvmName("vgnxqdcoarduwkoa")
public suspend fun aliasAuthorizationRuleId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.aliasAuthorizationRuleId = mapped
}
/**
* @param value Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
*/
@JvmName("ovbysgqeshsjrshw")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The ID of the Service Bus Namespace to replicate to.
*/
@JvmName("wuktqbqyffmcjjqi")
public suspend fun partnerNamespaceId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.partnerNamespaceId = mapped
}
/**
* @param value The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
*/
@JvmName("pkluynejydarhsfl")
public suspend fun primaryNamespaceId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.primaryNamespaceId = mapped
}
internal fun build(): NamespaceDisasterRecoveryConfigArgs = NamespaceDisasterRecoveryConfigArgs(
aliasAuthorizationRuleId = aliasAuthorizationRuleId,
name = name,
partnerNamespaceId = partnerNamespaceId,
primaryNamespaceId = primaryNamespaceId,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy