Skip to content

Commit

Permalink
Merge pull request #1 from RohitSquareops/main
Browse files Browse the repository at this point in the history
updated module structure, review and tested
  • Loading branch information
sunil-kumar-squareops authored May 18, 2023
2 parents c42b083 + 07a360e commit 39be052
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 133 deletions.
1 change: 0 additions & 1 deletion .tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,3 @@ rule "terraform_standard_module_structure" {
rule "terraform_workspace_remote" {
enabled = true
}

2 changes: 1 addition & 1 deletion IAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ The Policy required is:


```
<!-- END OF PRE-COMMIT-PIKE DOCS HOOK -->
<!-- END OF PRE-COMMIT-PIKE DOCS HOOK -->
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 SquareOps Technologies Pvt. Ltd.
Copyright 2023 SquareOps Technologies Pvt. Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
134 changes: 60 additions & 74 deletions README.md

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## RabbitMQ Example
![squareops_avatar]

[squareops_avatar]: https://squareops.com/wp-content/uploads/2022/12/squareops-logo.png

### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
<br>

This example will be very useful for users who are new to a module and want to quickly learn how to use it. By reviewing the examples, users can gain a better understanding of how the module works, what features it supports, and how to customize it to their specific needs.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

Expand All @@ -14,7 +24,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_rabbitmq"></a> [rabbitmq](#module\_rabbitmq) | ../../ | n/a |
| <a name="module_rabbitmq_broker"></a> [rabbitmq\_broker](#module\_rabbitmq\_broker) | [email protected]:sq-ia/terraform-aws-rabbitmq.git | n/a |

## Resources

Expand All @@ -28,8 +38,10 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_broker-arn"></a> [broker-arn](#output\_broker-arn) | ARN of the RabbitMQ broker. |
| <a name="output_broker-console_url"></a> [broker-console\_url](#output\_broker-console\_url) | The URL of the broker's RabbitMQ Web Console |
| <a name="output_broker-endpoint"></a> [broker-endpoint](#output\_broker-endpoint) | Broker's wire-level protocol endpoint |
| <a name="output_broker-id"></a> [broker-id](#output\_broker-id) | ID of the RabbitMQ broker. |
| <a name="output_broker-arn"></a> [broker-arn](#output\_broker-arn) | The Amazon Resource Name (ARN) of the RabbitMQ broker. |
| <a name="output_broker-console_url"></a> [broker-console\_url](#output\_broker-console\_url) | The URL of the RabbitMQ Web Console for managing the broker. |
| <a name="output_broker-endpoint"></a> [broker-endpoint](#output\_broker-endpoint) | The wire-level protocol endpoint of the RabbitMQ broker. |
| <a name="output_broker-id"></a> [broker-id](#output\_broker-id) | The unique identifier of the RabbitMQ broker. |
| <a name="output_rabbitmq_password"></a> [rabbitmq\_password](#output\_rabbitmq\_password) | The password for accessing the RabbitMQ cluster. Note that Terraform does not track this password after initial creation. |
| <a name="output_security_group"></a> [security\_group](#output\_security\_group) | The security group ID associated with the RabbitMQ cluster. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
44 changes: 23 additions & 21 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
locals {
name = "skaf"
region = "us-east-2"
environment = "production"
name = "skaf"
region = "us-east-1"
environment = "production"
engine_version = "3.10.20"
host_instance_type = "mq.m5.large"
vpc_id = "vpc-069a755f3a7"
subnet_ids = ["subnet-0bb23128ab"]
kms_key_arn = "arn:aws:kms:us-east-1:2222222222:key/bcfdc1c5-241e467d90"
allowed_security_groups = ["sg-0e8d8b08e40"]
}

module "rabbitmq_broker" {
source = "../../"
environment = local.environment
name = local.name
engine_type = "RabbitMQ"
engine_version = "3.8.23"
storage_type = "ebs"
host_instance_type = "mq.m5.large"
authentication_strategy = "simple"
deployment_mode = "SINGLE_INSTANCE"
apply_immediately = true
auto_minor_version_upgrade = false
publicly_accessible = false
vpc_id = "vpc-xyz5ed733e273skaf"
subnet_ids = ["subnet-xyz35ec60335fskaf"]
allowed_cidr_blocks = []
allowed_security_groups = ["sg-xyzf8bdc01fd9skaf"]
port = 5671
username = "admin"
source = "[email protected]:sq-ia/terraform-aws-rabbitmq.git"
name = local.name
username = "admin"
storage_type = "ebs"
engine_version = local.engine_version
host_instance_type = local.host_instance_type
environment = local.environment
vpc_id = local.vpc_id
subnet_ids = local.subnet_ids
deployment_mode = "SINGLE_INSTANCE"
apply_immediately = true
publicly_accessible = false
authentication_strategy = "simple"
allowed_security_groups = local.allowed_security_groups
maintenance_window_start_time = {
day_of_week = "SUNDAY"
time_of_day = "00:30"
Expand Down
12 changes: 6 additions & 6 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
output "broker-arn" {
description = "ARN of the RabbitMQ broker."
description = "The Amazon Resource Name (ARN) of the RabbitMQ broker."
value = module.rabbitmq_broker.rabbitmq_broker_arn
}

output "broker-id" {
description = "ID of the RabbitMQ broker."
description = "The unique identifier of the RabbitMQ broker."
value = module.rabbitmq_broker.rabbitmq_broker_id
}

output "broker-console_url" {
description = "The URL of the broker's RabbitMQ Web Console"
description = "The URL of the RabbitMQ Web Console for managing the broker."
value = module.rabbitmq_broker.rabbitmq_broker_console_url
}

output "broker-endpoint" {
description = "Broker's wire-level protocol endpoint"
description = "The wire-level protocol endpoint of the RabbitMQ broker."
value = module.rabbitmq_broker.rabbitmq_broker_endpoint
}

output "security_group" {
description = "The security group ID of the cluster"
description = "The security group ID associated with the RabbitMQ cluster."
value = module.rabbitmq_broker.rabbitmq_security_group
}

output "rabbitmq_password" {
description = "The Rabbitmq password (this password may be old, because Terraform doesn't track it after initial creation)"
description = "The password for accessing the RabbitMQ cluster. Note that Terraform does not track this password after initial creation."
value = module.rabbitmq_broker.rabbitmq_password

}
12 changes: 6 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
output "rabbitmq_broker_arn" {
description = "ARN of the RabbitMQ broker."
description = "The Amazon Resource Name (ARN) of the RabbitMQ broker."
value = aws_mq_broker.amazonmq.arn
}

output "rabbitmq_broker_id" {
description = "ID of the RabbitMQ broker."
description = "The unique identifier of the RabbitMQ broker."
value = aws_mq_broker.amazonmq.id
}

output "rabbitmq_broker_console_url" {
description = "The URL of the broker's RabbitMQ Web Console"
description = "The URL of the RabbitMQ Web Console for managing the broker."
value = aws_mq_broker.amazonmq.instances[0].console_url
}

output "rabbitmq_broker_endpoint" {
description = "Broker's wire-level protocol endpoint"
description = "The wire-level protocol endpoint of the RabbitMQ broker."
value = aws_mq_broker.amazonmq.instances[0].endpoints
}


output "rabbitmq_security_group" {
description = "The security group ID of the cluster"
description = "The security group ID associated with the RabbitMQ cluster."
value = module.security_group_mq.security_group_id
}

output "rabbitmq_password" {
description = "The Rabbitmq password (this password may be old, because Terraform doesn't track it after initial creation)"
description = "The password for accessing the RabbitMQ cluster. Note that Terraform does not track this password after initial creation."
value = nonsensitive(random_password.password.result)
}
34 changes: 17 additions & 17 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
variable "name" {
description = "The name of the amazonmq cluster"
description = "The name of the Amazon MQ cluster. It provides a unique identifier for the cluster."
type = string
default = ""
}

variable "environment" {
description = "The name of environment"
description = "The name of the environment where the Amazon MQ cluster is deployed."
type = string
default = ""
}

variable "vpc_id" {
description = "VPC ID"
description = "The ID of the VPC where the Amazon MQ cluster will be created."
type = string
default = ""
}

variable "allowed_cidr_blocks" {
description = "A list of CIDR blocks which are allowed to access the database"
description = "A list of CIDR blocks that are allowed to access the Amazon MQ cluster."
default = []
type = list(any)
}

variable "allowed_security_groups" {
description = "A list of Security Group ID's to allow access to"
description = "A list of Security Group IDs that are allowed to access the Amazon MQ cluster."
default = []
type = list(any)
}

variable "port" {
description = "The rabbit-mq cluster port number"
description = "The port number on which the RabbitMQ cluster will be accessible."
default = 5671
type = number
}

variable "subnet_ids" {
type = list(string)
default = []
description = "Subnet IDs in which to launch the broker.A SINGLE_INSTANCE deployment requires one subnet. An ACTIVE_STANDBY_MULTI_AZ deployment requires multiple subnets."
description = "The IDs of the subnets in which the Amazon MQ broker will be launched. "

}

variable "host_instance_type" {
type = string
default = ""
description = "(Required) Broker's instance type. For example, `mq.t3.micro`, `mq.m5.large`."
description = "The instance type of the Amazon MQ broker. For example, 'mq.t3.micro' or 'mq.m5.large'."
}

variable "engine_type" {
type = string
description = "(optional) Type of broker engine."
description = "The type of broker engine used in the Amazon MQ cluster."
default = "RabbitMQ"
}

variable "engine_version" {
type = string
default = ""
description = "(optional) Version of the broker engine. See the [AmazonMQ Broker Engine docs](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/broker-engine.html) for supported versions."
description = "The version of the broker engine used in the Amazon MQ cluster."
}

variable "storage_type" {
Expand All @@ -67,38 +67,38 @@ variable "storage_type" {

variable "authentication_strategy" {
type = string
description = "(optional) Authentication strategy used to secure the broker"
description = "The authentication strategy used to secure the broker."
default = "simple"
}

variable "deployment_mode" {
type = string
description = "(optional) description"
description = "The deployment mode of the Amazon MQ cluster."
default = "SINGLE_INSTANCE"
}

variable "apply_immediately" {
type = bool
description = "(Optional) Specifies whether any broker modifications are applied immediately, or during the next maintenance window."
description = "Specifies whether any broker modifications are applied immediately or during the next maintenance window."
default = true
}

variable "auto_minor_version_upgrade" {
type = bool
description = "(optional) Whether to automatically upgrade to new minor versions of brokers as Amazon MQ makes releases available."
description = "Whether to automatically upgrade to new minor versions of brokers as Amazon MQ makes releases available."
default = false
}

variable "publicly_accessible" {
type = bool
description = "(optional) Whether to enable connections from applications outside of the VPC that hosts the broker's subnets."
description = "Whether to enable connections from applications outside of the VPC that hosts the broker's subnets"
default = false
}

variable "username" {
type = string
default = ""
description = "Username of the user"
description = "The username of the user for authentication."
}

variable "maintenance_window_start_time" {
Expand All @@ -107,7 +107,7 @@ variable "maintenance_window_start_time" {
time_of_day = string
time_zone = string
})
description = "Configuration block for the maintenance window start time."
description = "The configuration block for the maintenance window start time."
default = {
day_of_week = "MONDAY"
time_of_day = "22:45"
Expand Down

0 comments on commit 39be052

Please sign in to comment.