Skip to content

Commit

Permalink
fix(master): Change module
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia Aghamyan committed Aug 14, 2023
1 parent 4ecf1de commit c8a254f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,21 @@ No resources.
|------|-------------|------|---------|:--------:|
| <a name="input_alerts"></a> [alerts](#input\_alerts) | Alerts | `any` | `[]` | no |
| <a name="input_application_channel_alerts"></a> [application\_channel\_alerts](#input\_application\_channel\_alerts) | Application channel alerts | `any` | `[]` | no |
| <a name="input_application_channel_webhook_url"></a> [application\_channel\_webhook\_url](#input\_application\_channel\_webhook\_url) | Application Teams Channel Webhook URL | `string` | n/a | yes |
| <a name="input_application_channel_webhook_url"></a> [application\_channel\_webhook\_url](#input\_application\_channel\_webhook\_url) | Application Teams Channel Webhook URL | `string` | `""` | no |
| <a name="input_application_monitroing_dashboard"></a> [application\_monitroing\_dashboard](#input\_application\_monitroing\_dashboard) | Application for monitoring EKS cluster | `any` | `[]` | no |
| <a name="input_create_alerts"></a> [create\_alerts](#input\_create\_alerts) | Create Alert | `bool` | `true` | no |
| <a name="input_create_application_channel"></a> [create\_application\_channel](#input\_create\_application\_channel) | Create application alert | `bool` | `true` | no |
| <a name="input_eks_monitroing_dashboard"></a> [eks\_monitroing\_dashboard](#input\_eks\_monitroing\_dashboard) | Dashboard for monitoring EKS cluster | `any` | `[]` | no |
| <a name="input_enable_log_base_metrics"></a> [enable\_log\_base\_metrics](#input\_enable\_log\_base\_metrics) | n/a | `bool` | `true` | no |
| <a name="input_enable_teams_notifications"></a> [enable\_teams\_notifications](#input\_enable\_teams\_notifications) | Enable Teams notifications | `bool` | `false` | no |
| <a name="input_fallback_email_addresses"></a> [fallback\_email\_addresses](#input\_fallback\_email\_addresses) | List of fallback email addresses to send notification when lambda failed | `list(string)` | `[]` | no |
| <a name="input_fallback_phone_numbers"></a> [fallback\_phone\_numbers](#input\_fallback\_phone\_numbers) | List of international formatted phone number to send notification when lambda failed | `list(string)` | `[]` | no |
| <a name="input_health_checks"></a> [health\_checks](#input\_health\_checks) | Health\_checks endpoints and paths | `any` | `[]` | no |
| <a name="input_log_base_metrics"></a> [log\_base\_metrics](#input\_log\_base\_metrics) | Log Base Metrics | `any` | `[]` | no |
| <a name="input_name"></a> [name](#input\_name) | Dashboard name | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The region where resources should be managed. In this repository it's secondary because IAM is always global. | `string` | `"eu-central-1"` | no |
| <a name="input_sns_topic_name"></a> [sns\_topic\_name](#input\_sns\_topic\_name) | SNS topic name | `string` | `"cloudwatch-alarm"` | no |
| <a name="input_webhook_url"></a> [webhook\_url](#input\_webhook\_url) | Teams Webhook URL | `string` | n/a | yes |
| <a name="input_webhook_url"></a> [webhook\_url](#input\_webhook\_url) | Teams Webhook URL | `string` | `""` | no |

## Outputs

Expand Down
6 changes: 3 additions & 3 deletions sns-topic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
}

module "sns-to-teams-application-channel" {
count = var.create_application_channel ? 1 : 0
count = var.enable_teams_notifications && var.create_application_channel ? 1 : 0

source = "./modules/cloudwatch-alarm-actions/"

Expand All @@ -19,7 +19,7 @@ module "sns-to-teams-application-channel" {
}

module "sns-to-teams" {
count = var.create_alerts ? 1 : 0
count = var.enable_teams_notifications && var.create_alerts ? 1 : 0

source = "./modules/cloudwatch-alarm-actions/"

Expand All @@ -33,7 +33,7 @@ module "sns-to-teams" {
}

module "sns-to-teams-virginia" {
count = length(var.health_checks) > 0 ? 1 : 0
count = var.enable_teams_notifications ? 1 : 0

source = "./modules/cloudwatch-alarm-actions/"

Expand Down
8 changes: 8 additions & 0 deletions vaiables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ variable "log_base_metrics" {
variable "webhook_url" {
type = string
description = "Teams Webhook URL"
default = ""
}

variable "application_channel_webhook_url" {
type = string
description = "Application Teams Channel Webhook URL"
default = ""
}

variable "alerts" {
Expand Down Expand Up @@ -89,3 +91,9 @@ variable "fallback_phone_numbers" {
default = []
description = "List of international formatted phone number to send notification when lambda failed"
}

variable "enable_teams_notifications" {
type = bool
default = false
description = "Enable Teams notifications"
}

0 comments on commit c8a254f

Please sign in to comment.