Eventhub Namespace Disaster Recovery Config Args
data class EventhubNamespaceDisasterRecoveryConfigArgs(val name: Output<String>? = null, val namespaceName: Output<String>? = null, val partnerNamespaceId: Output<String>? = null, val resourceGroupName: Output<String>? = null) : ConvertibleToJava<EventhubNamespaceDisasterRecoveryConfigArgs>
Manages an Disaster Recovery Config for an Event Hub Namespace.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "eventhub-replication",
location: "West Europe",
});
const primary = new azure.eventhub.EventHubNamespace("primary", {
name: "eventhub-primary",
location: example.location,
resourceGroupName: example.name,
sku: "Standard",
});
const secondary = new azure.eventhub.EventHubNamespace("secondary", {
name: "eventhub-secondary",
location: example.location,
resourceGroupName: example.name,
sku: "Standard",
});
const exampleEventhubNamespaceDisasterRecoveryConfig = new azure.eventhub.EventhubNamespaceDisasterRecoveryConfig("example", {
name: "replicate-eventhub",
resourceGroupName: example.name,
namespaceName: primary.name,
partnerNamespaceId: secondary.id,
});
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="eventhub-replication",
location="West Europe")
primary = azure.eventhub.EventHubNamespace("primary",
name="eventhub-primary",
location=example.location,
resource_group_name=example.name,
sku="Standard")
secondary = azure.eventhub.EventHubNamespace("secondary",
name="eventhub-secondary",
location=example.location,
resource_group_name=example.name,
sku="Standard")
example_eventhub_namespace_disaster_recovery_config = azure.eventhub.EventhubNamespaceDisasterRecoveryConfig("example",
name="replicate-eventhub",
resource_group_name=example.name,
namespace_name=primary.name,
partner_namespace_id=secondary.id)
Content copied to clipboard
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 = "eventhub-replication",
Location = "West Europe",
});
var primary = new Azure.EventHub.EventHubNamespace("primary", new()
{
Name = "eventhub-primary",
Location = example.Location,
ResourceGroupName = example.Name,
Sku = "Standard",
});
var secondary = new Azure.EventHub.EventHubNamespace("secondary", new()
{
Name = "eventhub-secondary",
Location = example.Location,
ResourceGroupName = example.Name,
Sku = "Standard",
});
var exampleEventhubNamespaceDisasterRecoveryConfig = new Azure.EventHub.EventhubNamespaceDisasterRecoveryConfig("example", new()
{
Name = "replicate-eventhub",
ResourceGroupName = example.Name,
NamespaceName = primary.Name,
PartnerNamespaceId = secondary.Id,
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/eventhub"
"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("eventhub-replication"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
primary, err := eventhub.NewEventHubNamespace(ctx, "primary", &eventhub.EventHubNamespaceArgs{
Name: pulumi.String("eventhub-primary"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: pulumi.String("Standard"),
})
if err != nil {
return err
}
secondary, err := eventhub.NewEventHubNamespace(ctx, "secondary", &eventhub.EventHubNamespaceArgs{
Name: pulumi.String("eventhub-secondary"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: pulumi.String("Standard"),
})
if err != nil {
return err
}
_, err = eventhub.NewEventhubNamespaceDisasterRecoveryConfig(ctx, "example", &eventhub.EventhubNamespaceDisasterRecoveryConfigArgs{
Name: pulumi.String("replicate-eventhub"),
ResourceGroupName: example.Name,
NamespaceName: primary.Name,
PartnerNamespaceId: secondary.ID(),
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.eventhub.EventHubNamespace;
import com.pulumi.azure.eventhub.EventHubNamespaceArgs;
import com.pulumi.azure.eventhub.EventhubNamespaceDisasterRecoveryConfig;
import com.pulumi.azure.eventhub.EventhubNamespaceDisasterRecoveryConfigArgs;
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("eventhub-replication")
.location("West Europe")
.build());
var primary = new EventHubNamespace("primary", EventHubNamespaceArgs.builder()
.name("eventhub-primary")
.location(example.location())
.resourceGroupName(example.name())
.sku("Standard")
.build());
var secondary = new EventHubNamespace("secondary", EventHubNamespaceArgs.builder()
.name("eventhub-secondary")
.location(example.location())
.resourceGroupName(example.name())
.sku("Standard")
.build());
var exampleEventhubNamespaceDisasterRecoveryConfig = new EventhubNamespaceDisasterRecoveryConfig("exampleEventhubNamespaceDisasterRecoveryConfig", EventhubNamespaceDisasterRecoveryConfigArgs.builder()
.name("replicate-eventhub")
.resourceGroupName(example.name())
.namespaceName(primary.name())
.partnerNamespaceId(secondary.id())
.build());
}
}
Content copied to clipboard
resources:
example:
type: azure:core:ResourceGroup
properties:
name: eventhub-replication
location: West Europe
primary:
type: azure:eventhub:EventHubNamespace
properties:
name: eventhub-primary
location: ${example.location}
resourceGroupName: ${example.name}
sku: Standard
secondary:
type: azure:eventhub:EventHubNamespace
properties:
name: eventhub-secondary
location: ${example.location}
resourceGroupName: ${example.name}
sku: Standard
exampleEventhubNamespaceDisasterRecoveryConfig:
type: azure:eventhub:EventhubNamespaceDisasterRecoveryConfig
name: example
properties:
name: replicate-eventhub
resourceGroupName: ${example.name}
namespaceName: ${primary.name}
partnerNamespaceId: ${secondary.id}
Content copied to clipboard
Import
EventHubs can be imported using the resource id
, e.g.
$ pulumi import azure:eventhub/eventhubNamespaceDisasterRecoveryConfig:EventhubNamespaceDisasterRecoveryConfig config1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/disasterRecoveryConfigs/config1
Content copied to clipboard
Properties
Link copied to clipboard
Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
Link copied to clipboard
The ID of the EventHub Namespace to replicate to.
Link copied to clipboard
The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.