Skip to content

Commit

Permalink
feat: create queues and topics (#61)
Browse files Browse the repository at this point in the history
* added block network_rule_set

* changes

* servicebus-queue

* modified servicebus module

* modified servicebus module

* modified servicebus module

* modified servicebus module

* modified servicebus module

* modified servicebus module

* modified servicebus module

* testing depends_on meta arg

* testing depends_on meta arg

* testing depends_on meta arg

* added networking block to config

* adjustments

* adjustments

* refactor: update network configuration (#52)

* chore: update required Azure provider version

Support for the `network_rule_set` block for resource `azurerm_servicebus_namespace` was added in Azure provider v3.71.

* refactor: rename variables

* refactor: remove variable for enabling network rules

* refactor: remove duplicate variable

* Fix configuration of Premium only features

* Deny public network access by default

* Dynamically configure network rules default action

* Rename variable

* Set optional object property

* Reorder blocks

* added queue and auth resources

* added variables for queue and auth

* added variables

* added variables

* added topic resource

* added topic resource

* updated and modified

* Update variables.tf

Co-authored-by: Henrik Simonsen Knutsen <[email protected]>

* Update variables.tf

Co-authored-by: Henrik Simonsen Knutsen <[email protected]>

* updated name for queues and topics

---------

Co-authored-by: Henrik Simonsen Knutsen <[email protected]>
  • Loading branch information
musifalsk and hknutsen authored Nov 26, 2024
1 parent c6950f9 commit 39aa8f5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ resource "azurerm_servicebus_namespace" "this" {
tags = var.tags
}

resource "azurerm_servicebus_queue" "this" {
for_each = var.queues

name = each.value.name
namespace_id = azurerm_servicebus_namespace.this.id
partitioning_enabled = each.value.partitioning_enabled
}

resource "azurerm_servicebus_topic" "this" {
for_each = var.topics

name = each.value.name
namespace_id = azurerm_servicebus_namespace.this.id
partitioning_enabled = each.value.partitioning_enabled
}

resource "azurerm_monitor_diagnostic_setting" "this" {
name = var.diagnostic_setting_name
target_resource_id = azurerm_servicebus_namespace.this.id
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@ variable "network_rule_set_trusted_services_allowed" {
nullable = false
}

variable "queues" {
description = "A map of queues to create for this Service Bus namespace."
type = map(object({
name = string
partitioning_enabled = optional(bool, false)
}))
default = {}
}

variable "topics" {
description = "A map of topics to create for this Service Bus namespace. Only applicable if value of SKU is \"Standard\" or \"Premium\"."
type = map(object({
name = string
partitioning_enabled = optional(bool, false)
}))
default = {}
}

variable "log_analytics_workspace_id" {
description = "The ID of the Log Analytics workspace to send diagnostics to."
type = string
Expand Down

0 comments on commit 39aa8f5

Please sign in to comment.