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,
});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);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:
- Namespace
Name string The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- Auto
Delete stringOn Idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- Default
Message stringTtl 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 stringHistory Time Window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- Enable
Batched boolOperations 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 intIn Megabytes 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.
- Requires
Duplicate boolDetection 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
ActiveorDisabled. Defaults toActive.- Support
Ordering bool Boolean flag which controls whether the Topic supports ordering. Defaults to false.
- Namespace
Name string The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- Auto
Delete stringOn Idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- Default
Message stringTtl 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 stringHistory Time Window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- Enable
Batched boolOperations 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 intIn Megabytes 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.
- Requires
Duplicate boolDetection 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
ActiveorDisabled. Defaults toActive.- Support
Ordering bool Boolean flag which controls whether the Topic supports ordering. Defaults to false.
- namespace
Name string The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.
- resource
Group stringName The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- auto
Delete stringOn Idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- default
Message stringTtl 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 stringHistory Time Window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- enable
Batched booleanOperations Boolean flag which controls if server-side batched operations are enabled. Defaults to false.
- enable
Express 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.
- enable
Partitioning 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.
- max
Size numberIn Megabytes 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.
- requires
Duplicate booleanDetection 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
ActiveorDisabled. Defaults toActive.- support
Ordering 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_ strname The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.
- auto_
delete_ stron_ idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- default_
message_ strttl 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_ strhistory_ time_ window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- enable_
batched_ booloperations 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_ floatin_ megabytes 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_ booldetection 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
ActiveorDisabled. Defaults toActive.- 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:
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): Topicstatic 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:
- Auto
Delete stringOn Idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- Default
Message stringTtl 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 stringHistory Time Window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- Enable
Batched boolOperations 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 intIn Megabytes 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.
- Namespace
Name string The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.
- Requires
Duplicate boolDetection Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.
- Resource
Group stringName 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
ActiveorDisabled. Defaults toActive.- Support
Ordering bool Boolean flag which controls whether the Topic supports ordering. Defaults to false.
- Auto
Delete stringOn Idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- Default
Message stringTtl 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 stringHistory Time Window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- Enable
Batched boolOperations 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 intIn Megabytes 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.
- Namespace
Name string The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.
- Requires
Duplicate boolDetection Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.
- Resource
Group stringName 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
ActiveorDisabled. Defaults toActive.- Support
Ordering bool Boolean flag which controls whether the Topic supports ordering. Defaults to false.
- auto
Delete stringOn Idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- default
Message stringTtl 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 stringHistory Time Window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- enable
Batched booleanOperations Boolean flag which controls if server-side batched operations are enabled. Defaults to false.
- enable
Express 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.
- enable
Partitioning 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.
- max
Size numberIn Megabytes 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.
- namespace
Name string The name of the ServiceBus Namespace to create this topic in. Changing this forces a new resource to be created.
- requires
Duplicate booleanDetection Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.
- resource
Group stringName 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
ActiveorDisabled. Defaults toActive.- support
Ordering boolean Boolean flag which controls whether the Topic supports ordering. Defaults to false.
- auto_
delete_ stron_ idle The ISO 8601 timespan duration of the idle interval after which the Topic is automatically deleted, minimum of 5 minutes.
- default_
message_ strttl 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_ strhistory_ time_ window The ISO 8601 timespan duration during which duplicates can be detected. Defaults to 10 minutes. (
PT10M)- enable_
batched_ booloperations 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_ floatin_ megabytes 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_ booldetection Boolean flag which controls whether the Topic requires duplicate detection. Defaults to false. Changing this forces a new resource to be created.
- resource_
group_ strname 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
ActiveorDisabled. Defaults toActive.- 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
azurermTerraform Provider.