1. Packages
  2. Azure Classic
  3. API Docs
  4. eventhub
  5. EventhubNamespaceDisasterRecoveryConfig

We recommend using Azure Native.

Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi

azure.eventhub.EventhubNamespaceDisasterRecoveryConfig

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi

    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,
    });
    
    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)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    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}
    

    Create EventhubNamespaceDisasterRecoveryConfig Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new EventhubNamespaceDisasterRecoveryConfig(name: string, args: EventhubNamespaceDisasterRecoveryConfigArgs, opts?: CustomResourceOptions);
    @overload
    def EventhubNamespaceDisasterRecoveryConfig(resource_name: str,
                                                args: EventhubNamespaceDisasterRecoveryConfigArgs,
                                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def EventhubNamespaceDisasterRecoveryConfig(resource_name: str,
                                                opts: Optional[ResourceOptions] = None,
                                                namespace_name: Optional[str] = None,
                                                partner_namespace_id: Optional[str] = None,
                                                resource_group_name: Optional[str] = None,
                                                name: Optional[str] = None)
    func NewEventhubNamespaceDisasterRecoveryConfig(ctx *Context, name string, args EventhubNamespaceDisasterRecoveryConfigArgs, opts ...ResourceOption) (*EventhubNamespaceDisasterRecoveryConfig, error)
    public EventhubNamespaceDisasterRecoveryConfig(string name, EventhubNamespaceDisasterRecoveryConfigArgs args, CustomResourceOptions? opts = null)
    public EventhubNamespaceDisasterRecoveryConfig(String name, EventhubNamespaceDisasterRecoveryConfigArgs args)
    public EventhubNamespaceDisasterRecoveryConfig(String name, EventhubNamespaceDisasterRecoveryConfigArgs args, CustomResourceOptions options)
    
    type: azure:eventhub:EventhubNamespaceDisasterRecoveryConfig
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args EventhubNamespaceDisasterRecoveryConfigArgs
    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 EventhubNamespaceDisasterRecoveryConfigArgs
    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 EventhubNamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EventhubNamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EventhubNamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var eventhubNamespaceDisasterRecoveryConfigResource = new Azure.EventHub.EventhubNamespaceDisasterRecoveryConfig("eventhubNamespaceDisasterRecoveryConfigResource", new()
    {
        NamespaceName = "string",
        PartnerNamespaceId = "string",
        ResourceGroupName = "string",
        Name = "string",
    });
    
    example, err := eventhub.NewEventhubNamespaceDisasterRecoveryConfig(ctx, "eventhubNamespaceDisasterRecoveryConfigResource", &eventhub.EventhubNamespaceDisasterRecoveryConfigArgs{
    	NamespaceName:      pulumi.String("string"),
    	PartnerNamespaceId: pulumi.String("string"),
    	ResourceGroupName:  pulumi.String("string"),
    	Name:               pulumi.String("string"),
    })
    
    var eventhubNamespaceDisasterRecoveryConfigResource = new EventhubNamespaceDisasterRecoveryConfig("eventhubNamespaceDisasterRecoveryConfigResource", EventhubNamespaceDisasterRecoveryConfigArgs.builder()
        .namespaceName("string")
        .partnerNamespaceId("string")
        .resourceGroupName("string")
        .name("string")
        .build());
    
    eventhub_namespace_disaster_recovery_config_resource = azure.eventhub.EventhubNamespaceDisasterRecoveryConfig("eventhubNamespaceDisasterRecoveryConfigResource",
        namespace_name="string",
        partner_namespace_id="string",
        resource_group_name="string",
        name="string")
    
    const eventhubNamespaceDisasterRecoveryConfigResource = new azure.eventhub.EventhubNamespaceDisasterRecoveryConfig("eventhubNamespaceDisasterRecoveryConfigResource", {
        namespaceName: "string",
        partnerNamespaceId: "string",
        resourceGroupName: "string",
        name: "string",
    });
    
    type: azure:eventhub:EventhubNamespaceDisasterRecoveryConfig
    properties:
        name: string
        namespaceName: string
        partnerNamespaceId: string
        resourceGroupName: string
    

    EventhubNamespaceDisasterRecoveryConfig 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 EventhubNamespaceDisasterRecoveryConfig resource accepts the following input properties:

    NamespaceName string
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    PartnerNamespaceId string
    The ID of the EventHub Namespace to replicate to.
    ResourceGroupName string
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    NamespaceName string
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    PartnerNamespaceId string
    The ID of the EventHub Namespace to replicate to.
    ResourceGroupName string
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespaceName String
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the EventHub Namespace to replicate to.
    resourceGroupName String
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespaceName string
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partnerNamespaceId string
    The ID of the EventHub Namespace to replicate to.
    resourceGroupName string
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name string
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespace_name str
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partner_namespace_id str
    The ID of the EventHub Namespace to replicate to.
    resource_group_name str
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name str
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespaceName String
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the EventHub Namespace to replicate to.
    resourceGroupName String
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EventhubNamespaceDisasterRecoveryConfig resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing EventhubNamespaceDisasterRecoveryConfig Resource

    Get an existing EventhubNamespaceDisasterRecoveryConfig 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?: EventhubNamespaceDisasterRecoveryConfigState, opts?: CustomResourceOptions): EventhubNamespaceDisasterRecoveryConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            namespace_name: Optional[str] = None,
            partner_namespace_id: Optional[str] = None,
            resource_group_name: Optional[str] = None) -> EventhubNamespaceDisasterRecoveryConfig
    func GetEventhubNamespaceDisasterRecoveryConfig(ctx *Context, name string, id IDInput, state *EventhubNamespaceDisasterRecoveryConfigState, opts ...ResourceOption) (*EventhubNamespaceDisasterRecoveryConfig, error)
    public static EventhubNamespaceDisasterRecoveryConfig Get(string name, Input<string> id, EventhubNamespaceDisasterRecoveryConfigState? state, CustomResourceOptions? opts = null)
    public static EventhubNamespaceDisasterRecoveryConfig get(String name, Output<String> id, EventhubNamespaceDisasterRecoveryConfigState 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.
    The following state arguments are supported:
    Name string
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    NamespaceName string
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    PartnerNamespaceId string
    The ID of the EventHub Namespace to replicate to.
    ResourceGroupName string
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    NamespaceName string
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    PartnerNamespaceId string
    The ID of the EventHub Namespace to replicate to.
    ResourceGroupName string
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespaceName String
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the EventHub Namespace to replicate to.
    resourceGroupName String
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name string
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespaceName string
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partnerNamespaceId string
    The ID of the EventHub Namespace to replicate to.
    resourceGroupName string
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name str
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespace_name str
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partner_namespace_id str
    The ID of the EventHub Namespace to replicate to.
    resource_group_name str
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Disaster Recovery Config. Changing this forces a new resource to be created.
    namespaceName String
    Specifies the name of the primary EventHub Namespace to replicate. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the EventHub Namespace to replicate to.
    resourceGroupName String
    The name of the resource group in which the Disaster Recovery Config exists. Changing this forces a new resource to be created.

    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
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi