Skip to content

Commit a583f4e

Browse files
feat/main: Refactor Terraform configurations: Update variables, outputs, and examples (#6)
* Refactor Terraform configurations: Update variables, outputs, and examples * feat: updated trigger --------- Co-authored-by: rakeshclouddevops <rakeshgangwar.clouddrove.com> Co-authored-by: Vishwajit Nagulkar <[email protected]>
1 parent 9c9a357 commit a583f4e

File tree

11 files changed

+504
-638
lines changed

11 files changed

+504
-638
lines changed

.github/workflows/changelog.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: changelog
22
permissions: write-all
33
on:
4-
push:
5-
tags:
6-
- "*"
4+
# push:
5+
# tags:
6+
# - "*"
77
workflow_dispatch:
88
jobs:
99
changelog:

examples/complete/README.md

-3
This file was deleted.

examples/complete/example.tf

+37-36
Original file line numberDiff line numberDiff line change
@@ -90,56 +90,57 @@ module "mq_broker" {
9090
source = "../.." # Reference the path of the root module where the MQ broker is defined
9191

9292
# Pass in the values to configure the MQ broker
93-
aws_region = var.aws_region
94-
mq_broker_name = var.mq_broker_name
95-
engine_type = var.engine_type
96-
engine_version = var.engine_version
97-
host_instance_type = var.host_instance_type
98-
broker_name = var.broker_name
93+
# aws_region = var.aws_region
94+
broker_name = var.mq_broker_name
95+
engine_type = var.engine_type
96+
engine_version = var.engine_version
97+
host_instance_type = var.host_instance_type
98+
# broker_name = var.broker_name
9999
deployment_mode = var.deployment_mode
100100
maintenance_day_of_week = var.maintenance_day_of_week
101-
maintenance_time = var.maintenance_time
101+
maintenance_time_of_day = var.maintenance_time_of_day
102+
maintenance_time_zone = var.maintenance_time_zone
102103
tags = var.tags
103104

104105
# Pass in the VPC and Subnet created by the VPC and Subnet modules
105-
vpc_id = module.vpc.vpc_id # Pass VPC ID
106-
subnet_ids = [module.public_subnet.public_subnet_id[0]] # Pass subnet IDs
107-
security_group_id = [module.security_group.security_group_id]
106+
vpc_id = module.vpc.vpc_id # Pass VPC ID
107+
subnet_ids = [module.public_subnet.public_subnet_id[0]] # Pass subnet IDs
108+
security_group_id = [module.security_group.security_group_id]
108109

109110
# MQ broker-specific settings
110-
apply_immediately = var.apply_immediately
111-
auto_minor_version_upgrade = var.auto_minor_version_upgrade
112-
publicly_accessible = var.publicly_accessible
113-
general_log_enabled = var.general_log_enabled
114-
audit_log_enabled = var.audit_log_enabled
115-
kms_mq_key_arn = var.kms_mq_key_arn
116-
use_aws_owned_key = var.use_aws_owned_key
117-
ssm_path = var.ssm_path
118-
encryption_enabled = var.encryption_enabled
119-
kms_ssm_key_arn = var.kms_ssm_key_arn
120-
allowed_ingress_ports = var.allowed_ingress_ports
111+
apply_immediately = var.apply_immediately
112+
auto_minor_version_upgrade = var.auto_minor_version_upgrade
113+
publicly_accessible = var.publicly_accessible
114+
general_log_enabled = var.general_log_enabled
115+
audit_log_enabled = var.audit_log_enabled
116+
kms_mq_key_arn = var.kms_mq_key_arn
117+
use_aws_owned_key = var.use_aws_owned_key
118+
ssm_path = var.ssm_path
119+
encryption_enabled = var.encryption_enabled
120+
kms_ssm_key_arn = var.kms_ssm_key_arn
121+
allowed_ingress_ports = var.allowed_ingress_ports
121122
additional_security_group_ids = var.additional_security_group_ids
122123

123124
# Admin and Application user credentials
124-
mq_admin_user = var.mq_admin_user
125-
mq_admin_password = var.mq_admin_password
126-
mq_application_user = var.mq_application_username
127-
mq_application_password = var.mq_application_password
128-
alias = format(
129-
"alias/%s",
130-
replace(var.alias, "[^a-zA-Z0-9_-]", "_")
131-
)
125+
mq_admin_user = var.mq_admin_user
126+
mq_admin_password = var.mq_admin_password
127+
# mq_application_user = var.mq_application_username
128+
# mq_application_password = var.mq_application_password
129+
# # alias = format(
130+
# "alias/%s",
131+
# replace(var.alias, "[^a-zA-Z0-9_-]", "_")
132+
# )
132133

133134
# CloudWatch Log Settings
134-
enable_cloudwatch_logs = var.enable_cloudwatch_logs
135-
cloudwatch_log_group_name = var.cloudwatch_log_group_name
136-
cloudwatch_log_retention_days = var.cloudwatch_log_retention_days
135+
# enable_cloudwatch_logs = var.enable_cloudwatch_logs
136+
# cloudwatch_log_group_name = var.cloudwatch_log_group_name
137+
# cloudwatch_log_retention_days = var.cloudwatch_log_retention_days
137138

138-
# Secrets Manager settings (if enabled)
139-
use_secrets_manager = var.use_secrets_manager
140-
secret_manager_key_prefix = var.secret_manager_key_prefix
139+
# # Secrets Manager settings (if enabled)
140+
# use_secrets_manager = var.use_secrets_manager
141+
# secret_manager_key_prefix = var.secret_manager_key_prefix
142+
# }
141143
}
142-
143144
output "security_group_id" {
144145
value = module.security_group.security_group_id
145146
description = "The Security Group ID"

examples/complete/output.tf

-14
This file was deleted.

examples/complete/outputs.tf

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# output "public_subnet_cidrs" {
2+
# value = module.subnets.public_subnet_cidrs
3+
# description = "Public subnet CIDR blocks"
4+
# }
5+
6+
# output "private_subnet_cidrs" {
7+
# value = module.subnets.private_subnet_cidrs
8+
# description = "Private subnet CIDR blocks"
9+
# }
10+
11+
# output "vpc_cidr" {
12+
# value = module.vpc.vpc_cidr_block
13+
# description = "VPC CIDR"
14+
# }
15+
16+
# output "broker_id" {
17+
# value = module.mq_broker.broker_id
18+
# description = "AmazonMQ broker ID"
19+
# }
20+
21+
# output "broker_arn" {
22+
# value = module.mq_broker.broker_arn
23+
# description = "AmazonMQ broker ARN"
24+
# }
25+
26+
# output "primary_console_url" {
27+
# value = module.mq_broker.primary_console_url
28+
# description = "AmazonMQ active web console URL"
29+
# }
30+
31+
# output "primary_ssl_endpoint" {
32+
# value = module.mq_broker.primary_ssl_endpoint
33+
# description = "AmazonMQ primary SSL endpoint"
34+
# }
35+
36+
# output "primary_amqp_ssl_endpoint" {
37+
# value = module.mq_broker.primary_amqp_ssl_endpoint
38+
# description = "AmazonMQ primary AMQP+SSL endpoint"
39+
# }
40+
41+
# output "primary_stomp_ssl_endpoint" {
42+
# value = module.mq_broker.primary_stomp_ssl_endpoint
43+
# description = "AmazonMQ primary STOMP+SSL endpoint"
44+
# }
45+
46+
# output "primary_mqtt_ssl_endpoint" {
47+
# value = module.mq_broker.primary_mqtt_ssl_endpoint
48+
# description = "AmazonMQ primary MQTT+SSL endpoint"
49+
# }
50+
51+
# output "primary_wss_endpoint" {
52+
# value = module.mq_broker.primary_wss_endpoint
53+
# description = "AmazonMQ primary WSS endpoint"
54+
# }
55+
56+
# output "primary_ip_address" {
57+
# value = module.mq_broker.primary_ip_address
58+
# description = "AmazonMQ primary IP address"
59+
# }
60+
61+
# output "secondary_console_url" {
62+
# value = module.mq_broker.secondary_console_url
63+
# description = "AmazonMQ secondary web console URL"
64+
# }
65+
66+
# output "secondary_ssl_endpoint" {
67+
# value = module.mq_broker.secondary_ssl_endpoint
68+
# description = "AmazonMQ secondary SSL endpoint"
69+
# }
70+
71+
# output "secondary_amqp_ssl_endpoint" {
72+
# value = module.mq_broker.secondary_amqp_ssl_endpoint
73+
# description = "AmazonMQ secondary AMQP+SSL endpoint"
74+
# }
75+
76+
# output "secondary_stomp_ssl_endpoint" {
77+
# value = module.mq_broker.secondary_stomp_ssl_endpoint
78+
# description = "AmazonMQ secondary STOMP+SSL endpoint"
79+
# }
80+
81+
# output "secondary_mqtt_ssl_endpoint" {
82+
# value = module.mq_broker.secondary_mqtt_ssl_endpoint
83+
# description = "AmazonMQ secondary MQTT+SSL endpoint"
84+
# }
85+
86+
# output "secondary_wss_endpoint" {
87+
# value = module.mq_broker.secondary_wss_endpoint
88+
# description = "AmazonMQ secondary WSS endpoint"
89+
# }
90+
91+
# output "secondary_ip_address" {
92+
# value = module.mq_broker.secondary_ip_address
93+
# description = "AmazonMQ secondary IP address"
94+
# }
95+
96+
# output "security_group_id" {
97+
# value = module.mq_broker.security_group_id
98+
# description = "AmazonMQ Security Group ID"
99+
# }
100+
101+
# output "security_group_arn" {
102+
# value = module.mq_broker.security_group_arn
103+
# description = "AmazonMQ Security Group ARN"
104+
# }
105+
106+
# output "security_group_name" {
107+
# value = module.mq_broker.security_group_name
108+
# description = "AmazonMQ Security Group name"
109+
# }

examples/complete/variables.auto.tfvars

-3
This file was deleted.

examples/complete/variables.tf

+17
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,20 @@ variable "secret_manager_key_prefix" {
252252
type = string
253253
default = "mq" # Default key prefix for Secrets Manager
254254
}
255+
variable "attributes" {
256+
description = "List of attributes to be used in SSM path"
257+
type = list(string)
258+
default = ["default_value"] # Provide a default value (a non-empty list)
259+
}
260+
261+
variable "maintenance_time_of_day" {
262+
description = "The time of day for the maintenance window (e.g., 02:00)."
263+
type = string
264+
default = "02:00" # Set a default value, or leave it blank if required
265+
}
266+
267+
variable "maintenance_time_zone" {
268+
description = "The time zone for the maintenance window (e.g., UTC, America/New_York)."
269+
type = string
270+
default = "UTC" # Set a default value, or leave it blank if required
271+
}

examples/complete/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
2+
# ------------------------------------------------------------------------------
3+
# Versions
4+
# ------------------------------------------------------------------------------
5+
16
terraform {
27
required_version = ">= 1.6.6"
38

49
required_providers {
510

611
aws = {
7-
source = "hashicorp/aws" #
12+
source = "hashicorp/aws"
813
version = ">= 5.31.0"
914
}
1015
}
1116
}
17+

0 commit comments

Comments
 (0)