Skip to content

Commit

Permalink
Variable and README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bczoma committed Feb 6, 2024
1 parent 63813ec commit cf63855
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 16 deletions.
48 changes: 46 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# terraform-solacebroker-queue-endpoint
Solace software broker Terraform module to abstract a broker queue endpoint or an endpoint template configuration
# Solace PubSub+ Software Event Broker Queue Endpoint Terraform Module

Terraform module to configure a "guaranteed messaging endpoint" or an "endpoint template" on the PubSub+ event broker. Note: "queue endpoint" in the title also refers to all these types as a generic name.

This module supports the configuration of one of the followings:

- a "queue" or a "topic endpoint": applications that make use of [Guaranteed Messaging](https://docs.solace.com/Messaging/Guaranteed-Msg/Guaranteed-Messages.htm), need [endpoints](https://docs.solace.com/Messaging/Guaranteed-Msg/Endpoints.htm) configured on the event broker to persist messages. A queue may also have a list of [topic subscriptions](https://docs.solace.com/API/API-Developer-Guide/Adding-Topic-Subscriptio.htm).

- a "queue template" or a "topic endpoint template": [Endpoint templates](https://docs.solace.com/Messaging/Guaranteed-Msg/Endpoint-Templates.htm?Highlight=Endpoint%20templates) may be used for new client created endpoints.

The module also supports exposing a created queue or topic endpoint via JNDI for JMS applications.

## Module variables

Endpoints and endpoint templates are specific to a Message VPN on the broker, therefore the Message VPN name is a mandatory module input variable.

Another mandatory input variable is the type of the endpoint or template to be created. Only one type can be created at a time.

Optional module variables are either shared by multiple types, or conditional to the type where incompatible variables will be ignored. For example, the `permission` variable is shared by all endpoint and template types but `queue_name_filter` is specific to the `queue_template` type and ignored for other types. The recommended approach to determine variable name mappings is to look up the endpoint or template resource's documentation for attribute names.

Most optional variables' default value is null. If they are not provided then the default for the related resource attribute will be configured on the broker.

## Examples

Refer to the following configuration examples:

- Queue
- Exclusive queue
- Non-exclusive queue
- Partitioned queue
- Queue with topic subscriptions
- Queue with exposed JNDI
- Queue template
- Topic endpoint
- Topic endpoint with exposed JNDI
- Topic endpoint template

## Module use recommendations

## Resources

For more information about Solace technology in general please visit these resources:

- The Solace Developer Portal website at: [solace.dev](//solace.dev/)
- Understanding [Solace technology](//solace.com/products/platform/)
- Ask the [Solace community](//dev.solace.com/community/).
10 changes: 5 additions & 5 deletions internal/gen-template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ resource "solacebroker_msg_vpn_queue" "main" {

msg_vpn_name = var.msg_vpn_name
queue_name = var.endpoint_name
ingress_enabled = true
egress_enabled = true
ingress_enabled = var.ingress_enabled
egress_enabled = var.egress_enabled

#AutoAddAttributes #EnableCommonVariables
}
Expand All @@ -30,10 +30,10 @@ resource "solacebroker_msg_vpn_topic_endpoint" "main" {

msg_vpn_name = var.msg_vpn_name
topic_endpoint_name = var.endpoint_name
ingress_enabled = true
egress_enabled = true
ingress_enabled = var.ingress_enabled
egress_enabled = var.egress_enabled

#AutoAddAttributes #EnableCommonVariables #RenameVariables {"max_spool_usage": "max_msg_spool_usage"}
#AutoAddAttributes #EnableCommonVariables

}

Expand Down
16 changes: 14 additions & 2 deletions internal/gen-template/variables.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Input variable definitions

variable "msg_vpn_name" {
description = "Message vpn name"
description = "The name of the Message VPN"
type = string
}

variable "endpoint_type" {
description = "Queue endpoint type. Must be one of `queue`, `topic_endpoint`, `queue_template` or `topic_endpoint_template`."
description = "The endpoint or template type. Must be one of `queue`, `topic_endpoint`, `queue_template` or `topic_endpoint_template`."
type = string
validation {
condition = contains(["queue", "topic_endpoint", "queue_template", "topic_endpoint_template"], var.endpoint_type)
Expand Down Expand Up @@ -37,4 +37,16 @@ variable "jndi_topic_name" {
default = ""
}

variable "ingress_enabled" {
description = "Enable or disable the reception of messages to the endpoint. The default value is `true`"
type = bool
default = true
}

variable "egress_enabled" {
description = "Enable or disable the transmission of messages from the endpoint. The default value is `true`"
type = bool
default = true
}

#AutoAddAttributes
10 changes: 5 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ resource "solacebroker_msg_vpn_queue" "main" {

msg_vpn_name = var.msg_vpn_name
queue_name = var.endpoint_name
ingress_enabled = true
egress_enabled = true
ingress_enabled = var.ingress_enabled
egress_enabled = var.egress_enabled

access_type = var.access_type
consumer_ack_propagation_enabled = var.consumer_ack_propagation_enabled
Expand Down Expand Up @@ -58,8 +58,8 @@ resource "solacebroker_msg_vpn_topic_endpoint" "main" {

msg_vpn_name = var.msg_vpn_name
topic_endpoint_name = var.endpoint_name
ingress_enabled = true
egress_enabled = true
ingress_enabled = var.ingress_enabled
egress_enabled = var.egress_enabled

access_type = var.access_type
consumer_ack_propagation_enabled = var.consumer_ack_propagation_enabled
Expand All @@ -73,7 +73,7 @@ resource "solacebroker_msg_vpn_topic_endpoint" "main" {
max_delivered_unacked_msgs_per_flow = var.max_delivered_unacked_msgs_per_flow
max_msg_size = var.max_msg_size
max_redelivery_count = var.max_redelivery_count
max_spool_usage = var.max_msg_spool_usage
max_spool_usage = var.max_spool_usage
max_ttl = var.max_ttl
owner = var.owner
permission = var.permission
Expand Down
22 changes: 20 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Input variable definitions

variable "msg_vpn_name" {
description = "Message vpn name"
description = "The name of the Message VPN"
type = string
}

variable "endpoint_type" {
description = "Queue endpoint type. Must be one of `queue`, `topic_endpoint`, `queue_template` or `topic_endpoint_template`."
description = "The endpoint or template type. Must be one of `queue`, `topic_endpoint`, `queue_template` or `topic_endpoint_template`."
type = string
validation {
condition = contains(["queue", "topic_endpoint", "queue_template", "topic_endpoint_template"], var.endpoint_type)
Expand Down Expand Up @@ -37,6 +37,18 @@ variable "jndi_topic_name" {
default = ""
}

variable "ingress_enabled" {
description = "Enable or disable the reception of messages to the endpoint. The default value is `true`"
type = bool
default = true
}

variable "egress_enabled" {
description = "Enable or disable the transmission of messages from the endpoint. The default value is `true`"
type = bool
default = true
}

variable "access_type" {
description = "The access type for delivering messages to consumer flows bound to the Queue."
type = string
Expand Down Expand Up @@ -147,6 +159,12 @@ variable "max_redelivery_count" {
default = null
}

variable "max_spool_usage" {
description = "The maximum message spool usage allowed by the Topic Endpoint, in megabytes (MB)."
type = number
default = null
}

variable "max_ttl" {
description = "The maximum time in seconds a message can stay in the Queue when `respect_ttl_enabled` is `\"true\"`."
type = number
Expand Down

0 comments on commit cf63855

Please sign in to comment.