Skip to content

azurermEventhubNamespaceDisasterRecoveryConfig

Manages an Disaster Recovery Config for an Event Hub Namespace.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "eventhub-replication",
  }
);
const azurermEventhubNamespacePrimary =
  new azurerm.eventhubNamespace.EventhubNamespace(this, "primary", {
    location: azurermResourceGroupExample.location,
    name: "eventhub-primary",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard",
  });
const azurermEventhubNamespaceSecondary =
  new azurerm.eventhubNamespace.EventhubNamespace(this, "secondary", {
    location: azurermResourceGroupExample.location,
    name: "eventhub-secondary",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard",
  });
const azurermEventhubNamespaceDisasterRecoveryConfigExample =
  new azurerm.eventhubNamespaceDisasterRecoveryConfig.EventhubNamespaceDisasterRecoveryConfig(
    this,
    "example_3",
    {
      name: "replicate-eventhub",
      namespace_name: azurermEventhubNamespacePrimary.name,
      partner_namespace_id: azurermEventhubNamespaceSecondary.id,
      resource_group_name: azurermResourceGroupExample.name,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermEventhubNamespaceDisasterRecoveryConfigExample.overrideLogicalId(
  "example"
);

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.

  • namespaceName - (Required) Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.

  • partnerNamespaceId - (Required) The ID of the EventHub Namespace to replicate to.

Attributes Reference

The following attributes are exported:

  • id - The EventHub Namespace Disaster Recovery Config ID.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the EventHub Namespace Disaster Recovery Config.
  • update - (Defaults to 30 minutes) Used when updating the EventHub Namespace Disaster Recovery Config.
  • read - (Defaults to 5 minutes) Used when retrieving the EventHub Namespace Disaster Recovery Config.
  • delete - (Defaults to 30 minutes) Used when deleting the EventHub Namespace Disaster Recovery Config.

Import

EventHubs can be imported using the resourceId, e.g.

terraform import azurerm_eventhub_namespace_disaster_recovery_config.config1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/disasterRecoveryConfigs/config1