Skip to content

Commit 5d56cbf

Browse files
Move alarm toggle to account level
1 parent be9acee commit 5d56cbf

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

infrastructure/terraform/components/api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ No requirements.
1717
| <a name="input_core_environment"></a> [core\_environment](#input\_core\_environment) | Environment of Core | `string` | `"prod"` | no |
1818
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | A map of default tags to apply to all taggable resources within the component | `map(string)` | `{}` | no |
1919
| <a name="input_disable_gateway_execute_endpoint"></a> [disable\_gateway\_execute\_endpoint](#input\_disable\_gateway\_execute\_endpoint) | Disable the execution endpoint for the API Gateway | `bool` | `true` | no |
20-
| <a name="input_enable_alarms_in_non_main"></a> [enable\_alarms\_in\_non\_main](#input\_enable\_alarms\_in\_non\_main) | Enable CloudWatch alarms in non-main environments (for example PR environments) | `bool` | `false` | no |
20+
| <a name="input_enable_alarms"></a> [enable\_alarms](#input\_enable\_alarms) | Enable CloudWatch alarms for this deployed environment | `bool` | `true` | no |
2121
| <a name="input_enable_api_data_trace"></a> [enable\_api\_data\_trace](#input\_enable\_api\_data\_trace) | Enable API Gateway data trace logging | `bool` | `false` | no |
2222
| <a name="input_enable_backups"></a> [enable\_backups](#input\_enable\_backups) | Enable backups | `bool` | `false` | no |
2323
| <a name="input_enable_event_cache"></a> [enable\_event\_cache](#input\_enable\_event\_cache) | Enable caching of events to an S3 bucket | `bool` | `true` | no |

infrastructure/terraform/components/api/locals_alarms.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
alarms_enabled = var.environment == "main" || var.enable_alarms_in_non_main
2+
alarms_enabled = var.enable_alarms
33

44
apigw_alarm_dimensions = {
55
ApiName = aws_api_gateway_rest_api.main.name

infrastructure/terraform/components/api/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ variable "enable_api_data_trace" {
194194
default = false
195195
}
196196

197-
variable "enable_alarms_in_non_main" {
197+
variable "enable_alarms" {
198198
type = bool
199-
description = "Enable CloudWatch alarms in non-main environments (for example PR environments)"
200-
default = false
199+
description = "Enable CloudWatch alarms for this deployed environment"
200+
default = true
201201
}

0 commit comments

Comments
 (0)