Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Commit e9abb00

Browse files
committed
feat: add module_version_monitoring_enabled var
1 parent 7ca6f08 commit e9abb00

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ JSON
9898

9999
resource "aws_cloudwatch_event_rule" "monitoring_jump_start_connection" {
100100
depends_on = [aws_sns_topic_subscription.marbot]
101-
count = var.enabled ? 1 : 0
101+
count = (var.module_version_monitoring_enabled && var.enabled) ? 1 : 0
102102

103103
name = "marbot-sqs-queue-connection-${random_id.id8.hex}"
104104
description = "Monitoring Jump Start connection (created by marbot)"
@@ -107,7 +107,7 @@ resource "aws_cloudwatch_event_rule" "monitoring_jump_start_connection" {
107107
}
108108

109109
resource "aws_cloudwatch_event_target" "monitoring_jump_start_connection" {
110-
count = var.enabled ? 1 : 0
110+
count = (var.module_version_monitoring_enabled && var.enabled) ? 1 : 0
111111

112112
rule = join("", aws_cloudwatch_event_rule.monitoring_jump_start_connection.*.name)
113113
target_id = "marbot"
@@ -116,7 +116,7 @@ resource "aws_cloudwatch_event_target" "monitoring_jump_start_connection" {
116116
{
117117
"Type": "monitoring-jump-start-tf-connection",
118118
"Module": "sqs-queue",
119-
"Version": "0.6.0",
119+
"Version": "0.7.0",
120120
"Partition": "${data.aws_partition.current.partition}",
121121
"AccountId": "${data.aws_caller_identity.current.account_id}",
122122
"Region": "${data.aws_region.current.name}"

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ variable "enabled" {
99
default = true
1010
}
1111

12+
variable "module_version_monitoring_enabled" {
13+
type = bool
14+
description = "Report the module version back to marbot to notify if updates are available."
15+
default = true
16+
}
17+
1218
variable "tags" {
1319
description = "A map of tags to add to all resources"
1420
type = map(string)

0 commit comments

Comments
 (0)