Topic

Manages a ServiceBus Topic.

Note Topics can only be created in Namespaces with an SKU of standard or higher.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new Azure.ServiceBus.NamespaceArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            Sku = "Standard",
            Tags = 
            {
                { "source", "example" },
            },
        });
        var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new Azure.ServiceBus.TopicArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            NamespaceName = exampleNamespace.Name,
            EnablePartitioning = true,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/servicebus"
    "github.com/pulumi/pulumi/sdk/v2/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
        }
        exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{
            Location:          exampleResourceGroup.Location,
            ResourceGroupName: exampleResourceGroup.Name,
            Sku:               pulumi.String("Standard"),
            Tags: pulumi.Map{
                "source": pulumi.String("example"),
            },
        })
        if err != nil {
            return err
        }
        _, err = servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{
            ResourceGroupName:  exampleResourceGroup.Name,
            NamespaceName:      exampleNamespace.Name,
            EnablePartitioning: pulumi.Bool(true),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_namespace = azure.servicebus.Namespace("exampleNamespace",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku="Standard",
    tags={
        "source": "example",
    })
example_topic = azure.servicebus.Topic("exampleTopic",
    resource_group_name=example_resource_group.name,
    namespace_name=example_namespace.name,
    enable_partitioning=True)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: "Standard",
    tags: {
        source: "example",
    },
});
const exampleTopic = new azure.servicebus.Topic("exampleTopic", {
    resourceGroupName: exampleResourceGroup.name,
    namespaceName: exampleNamespace.name,
    enablePartitioning: true,
});

Deprecated: azure.eventhub.Topic has been deprecated in favor of azure.servicebus.Topic

Create a Topic Resource

new Topic(name: string, args: TopicArgs, opts?: CustomResourceOptions);
def Topic(resource_name, opts=None, auto_delete_on_idle=None, default_message_ttl=None, duplicate_detection_history_time_window=None, enable_batched_operations=None, enable_express=None, enable_partitioning=None, max_size_in_megabytes=None, name=None, namespace_name=None, requires_duplicate_detection=None, resource_group_name=None, status=None, support_ordering=None, __props__=None);
func NewTopic(ctx *Context, name string, args TopicArgs, opts ...ResourceOption) (*Topic, error)
public Topic(string name, TopicArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TopicArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args TopicArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TopicArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Topic Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Topic resource accepts the following input properties:

NamespaceName string

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

AutoDeleteOnIdle string

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

DefaultMessageTtl string

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

DuplicateDetectionHistoryTimeWindow string

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

EnableBatchedOperations bool

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

EnableExpress bool

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

EnablePartitioning bool

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

MaxSizeInMegabytes int

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

Name string

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

RequiresDuplicateDetection bool

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

Status string

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

SupportOrdering bool

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

NamespaceName string

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

AutoDeleteOnIdle string

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

DefaultMessageTtl string

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

DuplicateDetectionHistoryTimeWindow string

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

EnableBatchedOperations bool

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

EnableExpress bool

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

EnablePartitioning bool

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

MaxSizeInMegabytes int

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

Name string

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

RequiresDuplicateDetection bool

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

Status string

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

SupportOrdering bool

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

namespaceName string

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

autoDeleteOnIdle string

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

defaultMessageTtl string

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

duplicateDetectionHistoryTimeWindow string

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

enableBatchedOperations boolean

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

enableExpress boolean

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

enablePartitioning boolean

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

maxSizeInMegabytes number

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

name string

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

requiresDuplicateDetection boolean

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

status string

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

supportOrdering boolean

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

namespace_name str

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

auto_delete_on_idle str

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

default_message_ttl str

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

duplicate_detection_history_time_window str

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

enable_batched_operations bool

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

enable_express bool

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

enable_partitioning bool

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

max_size_in_megabytes float

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

name str

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

requires_duplicate_detection bool

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

status str

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

support_ordering bool

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the Topic 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing Topic Resource

Get an existing Topic 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?: TopicState, opts?: CustomResourceOptions): Topic
static get(resource_name, id, opts=None, auto_delete_on_idle=None, default_message_ttl=None, duplicate_detection_history_time_window=None, enable_batched_operations=None, enable_express=None, enable_partitioning=None, max_size_in_megabytes=None, name=None, namespace_name=None, requires_duplicate_detection=None, resource_group_name=None, status=None, support_ordering=None, __props__=None);
func GetTopic(ctx *Context, name string, id IDInput, state *TopicState, opts ...ResourceOption) (*Topic, error)
public static Topic Get(string name, Input<string> id, TopicState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AutoDeleteOnIdle string

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

DefaultMessageTtl string

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

DuplicateDetectionHistoryTimeWindow string

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

EnableBatchedOperations bool

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

EnableExpress bool

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

EnablePartitioning bool

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

MaxSizeInMegabytes int

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

Name string

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

NamespaceName string

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

RequiresDuplicateDetection bool

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

Status string

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

SupportOrdering bool

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

AutoDeleteOnIdle string

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

DefaultMessageTtl string

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

DuplicateDetectionHistoryTimeWindow string

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

EnableBatchedOperations bool

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

EnableExpress bool

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

EnablePartitioning bool

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

MaxSizeInMegabytes int

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

Name string

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

NamespaceName string

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

RequiresDuplicateDetection bool

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

Status string

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

SupportOrdering bool

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

autoDeleteOnIdle string

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

defaultMessageTtl string

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

duplicateDetectionHistoryTimeWindow string

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

enableBatchedOperations boolean

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

enableExpress boolean

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

enablePartitioning boolean

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

maxSizeInMegabytes number

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

name string

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

namespaceName string

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

requiresDuplicateDetection boolean

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

status string

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

supportOrdering boolean

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

auto_delete_on_idle str

The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.

default_message_ttl str

The ISO 8601 timespan duration of TTL of messages sent to this topic if no TTL value is set on the message itself.

duplicate_detection_history_time_window str

The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (PT10M)

enable_batched_operations bool

Boolean flag which controls if server-side batched operations are enabled. Defaults to false.

enable_express bool

Boolean flag which controls whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. Defaults to false.

enable_partitioning bool

Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Defaults to false. Changing this forces a new resource to be created.

max_size_in_megabytes float

Integer value which controls the size of memory allocated for the topic. For supported values see the “Queue/topic size” section of this document.

name str

Specifies the name of the ServiceBus Topic resource. Changing this forces a new resource to be created.

namespace_name str

The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.

requires_duplicate_detection bool

Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

status str

The Status of the Service Bus Topic. Acceptable values are Active or Disabled. Defaults to Active.

support_ordering bool

Boolean flag which controls whether the Topic supports ordering. Defaults to false.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.