azure.servicebus.NamespaceDisasterRecoveryConfig
Manages a Disaster Recovery Config for a Service Bus Namespace.
NOTE: Disaster Recovery Config is a Premium SKU only capability.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "West Europe",
});
var primary = new Azure.ServiceBus.Namespace("primary", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = "Premium",
Capacity = 1,
});
var secondary = new Azure.ServiceBus.Namespace("secondary", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = "Premium",
Capacity = 1,
});
var exampleNamespaceAuthorizationRule = new Azure.ServiceBus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", new()
{
NamespaceId = azurerm_servicebus_namespace.Example.Id,
Listen = true,
Send = true,
Manage = false,
});
var exampleNamespaceDisasterRecoveryConfig = new Azure.ServiceBus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", new()
{
PrimaryNamespaceId = primary.Id,
PartnerNamespaceId = secondary.Id,
AliasAuthorizationRuleId = exampleNamespaceAuthorizationRule.Id,
});
});
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 {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
primary, err := servicebus.NewNamespace(ctx, "primary", &servicebus.NamespaceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: pulumi.String("Premium"),
Capacity: pulumi.Int(1),
})
if err != nil {
return err
}
secondary, err := servicebus.NewNamespace(ctx, "secondary", &servicebus.NamespaceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: pulumi.String("Premium"),
Capacity: pulumi.Int(1),
})
if err != nil {
return err
}
exampleNamespaceAuthorizationRule, err := servicebus.NewNamespaceAuthorizationRule(ctx, "exampleNamespaceAuthorizationRule", &servicebus.NamespaceAuthorizationRuleArgs{
NamespaceId: pulumi.Any(azurerm_servicebus_namespace.Example.Id),
Listen: pulumi.Bool(true),
Send: pulumi.Bool(true),
Manage: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = servicebus.NewNamespaceDisasterRecoveryConfig(ctx, "exampleNamespaceDisasterRecoveryConfig", &servicebus.NamespaceDisasterRecoveryConfigArgs{
PrimaryNamespaceId: primary.ID(),
PartnerNamespaceId: secondary.ID(),
AliasAuthorizationRuleId: exampleNamespaceAuthorizationRule.ID(),
})
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.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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var primary = new Namespace("primary", NamespaceArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.sku("Premium")
.capacity("1")
.build());
var secondary = new Namespace("secondary", NamespaceArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.sku("Premium")
.capacity("1")
.build());
var exampleNamespaceAuthorizationRule = new NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", NamespaceAuthorizationRuleArgs.builder()
.namespaceId(azurerm_servicebus_namespace.example().id())
.listen(true)
.send(true)
.manage(false)
.build());
var exampleNamespaceDisasterRecoveryConfig = new NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", NamespaceDisasterRecoveryConfigArgs.builder()
.primaryNamespaceId(primary.id())
.partnerNamespaceId(secondary.id())
.aliasAuthorizationRuleId(exampleNamespaceAuthorizationRule.id())
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
primary = azure.servicebus.Namespace("primary",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku="Premium",
capacity=1)
secondary = azure.servicebus.Namespace("secondary",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku="Premium",
capacity=1)
example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule",
namespace_id=azurerm_servicebus_namespace["example"]["id"],
listen=True,
send=True,
manage=False)
example_namespace_disaster_recovery_config = azure.servicebus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig",
primary_namespace_id=primary.id,
partner_namespace_id=secondary.id,
alias_authorization_rule_id=example_namespace_authorization_rule.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const primary = new azure.servicebus.Namespace("primary", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: "Premium",
capacity: 1,
});
const secondary = new azure.servicebus.Namespace("secondary", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: "Premium",
capacity: 1,
});
const exampleNamespaceAuthorizationRule = new azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", {
namespaceId: azurerm_servicebus_namespace.example.id,
listen: true,
send: true,
manage: false,
});
const exampleNamespaceDisasterRecoveryConfig = new azure.servicebus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", {
primaryNamespaceId: primary.id,
partnerNamespaceId: secondary.id,
aliasAuthorizationRuleId: exampleNamespaceAuthorizationRule.id,
});
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
primary:
type: azure:servicebus:Namespace
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
sku: Premium
capacity: '1'
secondary:
type: azure:servicebus:Namespace
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
sku: Premium
capacity: '1'
exampleNamespaceAuthorizationRule:
type: azure:servicebus:NamespaceAuthorizationRule
properties:
namespaceId: ${azurerm_servicebus_namespace.example.id}
listen: true
send: true
manage: false
exampleNamespaceDisasterRecoveryConfig:
type: azure:servicebus:NamespaceDisasterRecoveryConfig
properties:
primaryNamespaceId: ${primary.id}
partnerNamespaceId: ${secondary.id}
aliasAuthorizationRuleId: ${exampleNamespaceAuthorizationRule.id}
Create NamespaceDisasterRecoveryConfig Resource
new NamespaceDisasterRecoveryConfig(name: string, args: NamespaceDisasterRecoveryConfigArgs, opts?: CustomResourceOptions);
@overload
def NamespaceDisasterRecoveryConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
alias_authorization_rule_id: Optional[str] = None,
name: Optional[str] = None,
partner_namespace_id: Optional[str] = None,
primary_namespace_id: Optional[str] = None)
@overload
def NamespaceDisasterRecoveryConfig(resource_name: str,
args: NamespaceDisasterRecoveryConfigArgs,
opts: Optional[ResourceOptions] = None)
func NewNamespaceDisasterRecoveryConfig(ctx *Context, name string, args NamespaceDisasterRecoveryConfigArgs, opts ...ResourceOption) (*NamespaceDisasterRecoveryConfig, error)
public NamespaceDisasterRecoveryConfig(string name, NamespaceDisasterRecoveryConfigArgs args, CustomResourceOptions? opts = null)
public NamespaceDisasterRecoveryConfig(String name, NamespaceDisasterRecoveryConfigArgs args)
public NamespaceDisasterRecoveryConfig(String name, NamespaceDisasterRecoveryConfigArgs args, CustomResourceOptions options)
type: azure:servicebus:NamespaceDisasterRecoveryConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NamespaceDisasterRecoveryConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NamespaceDisasterRecoveryConfigArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NamespaceDisasterRecoveryConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NamespaceDisasterRecoveryConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NamespaceDisasterRecoveryConfigArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
NamespaceDisasterRecoveryConfig Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The NamespaceDisasterRecoveryConfig resource accepts the following input properties:
- Partner
Namespace stringId The ID of the Service Bus Namespace to replicate to.
- Primary
Namespace stringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- string
The Shared access policies used to access the connection string for the alias.
- Name string
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.
- Partner
Namespace stringId The ID of the Service Bus Namespace to replicate to.
- Primary
Namespace stringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- string
The Shared access policies used to access the connection string for the alias.
- Name string
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.
- partner
Namespace StringId The ID of the Service Bus Namespace to replicate to.
- primary
Namespace StringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- String
The Shared access policies used to access the connection string for the alias.
- name String
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.
- partner
Namespace stringId The ID of the Service Bus Namespace to replicate to.
- primary
Namespace stringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- string
The Shared access policies used to access the connection string for the alias.
- name string
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.
- partner_
namespace_ strid The ID of the Service Bus Namespace to replicate to.
- primary_
namespace_ strid The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- str
The Shared access policies used to access the connection string for the alias.
- name str
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.
- partner
Namespace StringId The ID of the Service Bus Namespace to replicate to.
- primary
Namespace StringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- String
The Shared access policies used to access the connection string for the alias.
- name String
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.
Outputs
All input properties are implicitly available as output properties. Additionally, the NamespaceDisasterRecoveryConfig resource produces the following output properties:
- Default
Primary stringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- Default
Secondary stringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- Id string
The provider-assigned unique ID for this managed resource.
- Primary
Connection stringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- Secondary
Connection stringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- Default
Primary stringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- Default
Secondary stringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- Id string
The provider-assigned unique ID for this managed resource.
- Primary
Connection stringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- Secondary
Connection stringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary StringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default
Secondary StringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- id String
The provider-assigned unique ID for this managed resource.
- primary
Connection StringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- secondary
Connection StringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary stringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default
Secondary stringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- id string
The provider-assigned unique ID for this managed resource.
- primary
Connection stringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- secondary
Connection stringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- default_
primary_ strkey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default_
secondary_ strkey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- id str
The provider-assigned unique ID for this managed resource.
- primary_
connection_ strstring_ alias The alias Primary Connection String for the ServiceBus Namespace.
- secondary_
connection_ strstring_ alias The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary StringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default
Secondary StringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- id String
The provider-assigned unique ID for this managed resource.
- primary
Connection StringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- secondary
Connection StringString Alias The alias Secondary Connection String for the ServiceBus Namespace
Look up Existing NamespaceDisasterRecoveryConfig Resource
Get an existing NamespaceDisasterRecoveryConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NamespaceDisasterRecoveryConfigState, opts?: CustomResourceOptions): NamespaceDisasterRecoveryConfig
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alias_authorization_rule_id: Optional[str] = None,
default_primary_key: Optional[str] = None,
default_secondary_key: Optional[str] = None,
name: Optional[str] = None,
partner_namespace_id: Optional[str] = None,
primary_connection_string_alias: Optional[str] = None,
primary_namespace_id: Optional[str] = None,
secondary_connection_string_alias: Optional[str] = None) -> NamespaceDisasterRecoveryConfig
func GetNamespaceDisasterRecoveryConfig(ctx *Context, name string, id IDInput, state *NamespaceDisasterRecoveryConfigState, opts ...ResourceOption) (*NamespaceDisasterRecoveryConfig, error)
public static NamespaceDisasterRecoveryConfig Get(string name, Input<string> id, NamespaceDisasterRecoveryConfigState? state, CustomResourceOptions? opts = null)
public static NamespaceDisasterRecoveryConfig get(String name, Output<String> id, NamespaceDisasterRecoveryConfigState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- string
The Shared access policies used to access the connection string for the alias.
- Default
Primary stringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- Default
Secondary stringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- Name string
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.
- Partner
Namespace stringId The ID of the Service Bus Namespace to replicate to.
- Primary
Connection stringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- Primary
Namespace stringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- Secondary
Connection stringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- string
The Shared access policies used to access the connection string for the alias.
- Default
Primary stringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- Default
Secondary stringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- Name string
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.
- Partner
Namespace stringId The ID of the Service Bus Namespace to replicate to.
- Primary
Connection stringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- Primary
Namespace stringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- Secondary
Connection stringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- String
The Shared access policies used to access the connection string for the alias.
- default
Primary StringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default
Secondary StringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- name String
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.
- partner
Namespace StringId The ID of the Service Bus Namespace to replicate to.
- primary
Connection StringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- primary
Namespace StringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary
Connection StringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- string
The Shared access policies used to access the connection string for the alias.
- default
Primary stringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default
Secondary stringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- name string
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.
- partner
Namespace stringId The ID of the Service Bus Namespace to replicate to.
- primary
Connection stringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- primary
Namespace stringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary
Connection stringString Alias The alias Secondary Connection String for the ServiceBus Namespace
- str
The Shared access policies used to access the connection string for the alias.
- default_
primary_ strkey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default_
secondary_ strkey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- name str
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.
- partner_
namespace_ strid The ID of the Service Bus Namespace to replicate to.
- primary_
connection_ strstring_ alias The alias Primary Connection String for the ServiceBus Namespace.
- primary_
namespace_ strid The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary_
connection_ strstring_ alias The alias Secondary Connection String for the ServiceBus Namespace
- String
The Shared access policies used to access the connection string for the alias.
- default
Primary StringKey The primary access key for the authorization rule
RootManageSharedAccessKey
.- default
Secondary StringKey The secondary access key for the authorization rule
RootManageSharedAccessKey
.- name String
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.
- partner
Namespace StringId The ID of the Service Bus Namespace to replicate to.
- primary
Connection StringString Alias The alias Primary Connection String for the ServiceBus Namespace.
- primary
Namespace StringId The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary
Connection StringString Alias The alias Secondary Connection String for the ServiceBus Namespace
Import
Service Bus DR configs can be imported using the resource id
, e.g.
$ pulumi import azure:servicebus/namespaceDisasterRecoveryConfig:NamespaceDisasterRecoveryConfig config1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ServiceBus/namespaces/namespace1/disasterRecoveryConfigs/config1
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.