Azure Messaging Topic
This page shows how to write Terraform for Messaging Topic and write them securely.
azurerm_servicebus_topic (Terraform)
The Topic in Messaging can be configured in Terraform with the resource name azurerm_servicebus_topic
. The following sections describe 6 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_servicebus_topic" "testrbtopic1" {
name = var.sbTopicName1
resource_group_name = azurerm_resource_group.rgtestsb.name
namespace_name = azurerm_servicebus_namespace.testsbname.name
enable_partitioning = var.enable_partitioning_topic1
}
resource "azurerm_servicebus_topic" "sb_topic_hr" {
name = ""
resource_group_name = var.resource_group_name
namespace_name = azurerm_servicebus_namespace.sb.name
depends_on = [azurerm_kubernetes_cluster.k8s]
enable_partitioning = false
resource "azurerm_servicebus_topic" "topic" {
name = var.name
resource_group_name = var.resource_group_name
namespace_name = var.azure_bus_namespace
enable_partitioning = var.enable_partitioning
}
resource "azurerm_servicebus_topic" "topic" {
for_each = toset(local.topics)
# count = length(local.topics)
name = each.value.name #local.topics[count.index].name
resource_group_name = var.resource_group_name
resource "azurerm_servicebus_topic" "properties-created" {
name = "propt.properties.propterycreated.v1"
resource_group_name = var.servicebus_name
namespace_name = var.servicebus_rg
enable_partitioning = true
resource "azurerm_servicebus_topic" "sb_topic_name" {
name = random_string.sb_topic.result
resource_group_name = azurerm_resource_group.rg.name
namespace_name = azurerm_servicebus_namespace.sb_namespace.name
enable_partitioning = true
Parameters
-
auto_delete_on_idle
optional computed - string -
default_message_ttl
optional computed - string -
duplicate_detection_history_time_window
optional computed - string -
enable_batched_operations
optional - bool -
enable_express
optional - bool -
enable_partitioning
optional - bool -
id
optional computed - string -
max_size_in_megabytes
optional computed - number -
name
required - string -
namespace_name
required - string -
requires_duplicate_detection
optional - bool -
resource_group_name
required - string -
status
optional - string -
support_ordering
optional - bool -
timeouts
single block
Explanation in Terraform Registry
Manages a ServiceBus Topic. Note Topics can only be created in Namespaces with an SKU of
standard
or higher.
Azure Resource Manager Example
Azure Resource Manager code does not have the related resource.
Frequently asked questions
What is Azure Messaging Topic?
Azure Messaging Topic is a resource for Messaging of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Messaging Topic?
For Terraform, the iac-coder/modularteracodestructure, mnhat3896/Automated-Provisioning and atticalabs/terraform source code examples are useful. See the Terraform Example section for further details.