Skip to content

Commit

Permalink
Add AmazonMQ module
Browse files Browse the repository at this point in the history
  • Loading branch information
hiranadikari committed Jan 22, 2024
1 parent 201a1fb commit 62fe3c8
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 0 deletions.
36 changes: 36 additions & 0 deletions modules/aws/MQ/aws_mq_broker.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

resource "aws_mq_broker" "mq" {
broker_name = join("-", [var.project, var.application, var.environment, var.region, "mq"])

engine_type = "ActiveMQ"
engine_version = var.engine_version
host_instance_type = var.instance_type
security_groups = var.security_group_ids
subnet_ids = var.subnet_ids
publicly_accessible = var.public_access
auto_minor_version_upgrade = var.auto_minor_version_upgrade

dynamic "user" {
for_each = var.users
content {
username = user.value.username
password = user.value.password
console_access = user.value.console_access
}
}

logs {
audit = var.audit_logs_enabled
general = var.general_logs_enabled
}
}
14 changes: 14 additions & 0 deletions modules/aws/MQ/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

output "aws_mq_broker_name" {
value = aws_mq_broker.mq.broker_name
}
65 changes: 65 additions & 0 deletions modules/aws/MQ/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

variable "project" {
type = string
description = "Name of the project"
}
variable "environment" {
type = string
description = "Name of the environment"
}
variable "region" {
type = string
description = "Code of the region"
}
variable "application" {
type = string
description = "Purpose of the EKS Cluster"
}
variable "engine_version" {
type = string
}
variable "instance_type" {
type = string
}
variable "security_group_ids" {
type = list(string)
default = null
}
variable "audit_logs_enabled" {
type = bool
default = false
}
variable "general_logs_enabled" {
type = bool
default = false
}
variable "users" {
type = list(object({
username = string
password = string
console_access = bool
}))
default = []
}
variable "subnet_ids" {
type = list(string)
default = []
}
variable "public_access" {
type = bool
default = false
}
variable "auto_minor_version_upgrade" {
type = bool
default = false
}

0 comments on commit 62fe3c8

Please sign in to comment.