Skip to content

Commit

Permalink
feat: Add az-asb tf module
Browse files Browse the repository at this point in the history
  • Loading branch information
using-system committed Mar 17, 2024
1 parent 7aacf94 commit be02948
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
27 changes: 27 additions & 0 deletions terraform/modules/az-asb/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "azurerm_servicebus_namespace" "asb" {
name = var.name
location = var.location
resource_group_name = var.resource_group_name
sku = var.sku
capacity = var.capacity

public_network_access_enabled = var.public_network_access_enabled

dynamic "network_rule_set" {
for_each = var.subnet_ids.length > 0 ? [1] : []
content {
public_network_access_enabled = var.public_network_access_enabled
default_action = var.network_rules_default_action
trusted_services_allowed = var.trusted_services_allowed

dynamic "network_rules" {
for_each = var.subnet_ids
content {
subnet_id = network_rules.value
}
}
}
}

tags = var.tags
}
53 changes: 53 additions & 0 deletions terraform/modules/az-asb/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
variable "name" {
description = "Name of the azure bus namespace"
}

variable "location" {
description = "Azure Region Location"
type = string
}

variable "resource_group_name" {
description = "Resource group name of the azure bus namespace"
}

variable "sku" {
description = "The SKU of the Azure Service Bus Namespace"
type = string
default = "Premium"
}

variable "capacity" {
description = "The capacity of the Azure Service Bus Namespace"
type = number
default = 1
}

variable "public_network_access_enabled" {
description = "Is public network access enabled for the Azure Service Bus Namespace"
type = bool
default = false
}

variable "subnet_ids" {
description = "The list of subnet ids to associate with the Azure Service Bus Namespace"
type = list(string)
default = []
}

variable "network_rules_default_action" {
description = "The default action of the network rules"
type = string
default = "Deny"
}

variable "trusted_services_allowed" {
description = "The list of trusted services allowed"
type = bool
default = false
}

variable "tags" {
description = "Tags to associate with resources."
type = map(string)
}

0 comments on commit be02948

Please sign in to comment.