Skip to content

Commit

Permalink
add cloudwatch ok alarm actions (#32)
Browse files Browse the repository at this point in the history
* add cloudwatch ok alarm actions

* updating readme from makefile
  • Loading branch information
veilig2000 authored and osterman committed Dec 23, 2018
1 parent 45eb88f commit 277a6ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Available targets:
lint Lint terraform code
```

## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -122,6 +121,7 @@ Available targets:
| name | Name | string | `redis` | no |
| namespace | Namespace | string | `global` | no |
| notification_topic_arn | Notification topic arn | string | `` | no |
| ok_actions | The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN) | list | `<list>` | no |
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no |
| port | Redis port | string | `6379` | no |
| replication_group_id | Replication group ID with the following constraints: A name must contain from 1 to 20 alphanumeric characters or hyphens. The first character must be a letter. A name cannot end with a hyphen or contain two consecutive hyphens. | string | `` | no |
Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -22,6 +21,7 @@
| name | Name | string | `redis` | no |
| namespace | Namespace | string | `global` | no |
| notification_topic_arn | Notification topic arn | string | `` | no |
| ok_actions | The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN) | list | `<list>` | no |
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no |
| port | Redis port | string | `6379` | no |
| replication_group_id | Replication group ID with the following constraints: A name must contain from 1 to 20 alphanumeric characters or hyphens. The first character must be a letter. A name cannot end with a hyphen or contain two consecutive hyphens. | string | `` | no |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ resource "aws_cloudwatch_metric_alarm" "cache_cpu" {
}

alarm_actions = ["${var.alarm_actions}"]
ok_actions = ["${var.ok_actions}"]
depends_on = ["aws_elasticache_replication_group.default"]
}

Expand All @@ -113,6 +114,7 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {
}

alarm_actions = ["${var.alarm_actions}"]
ok_actions = ["${var.ok_actions}"]
depends_on = ["aws_elasticache_replication_group.default"]
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ variable "alarm_actions" {
default = []
}

variable "ok_actions" {
type = "list"
description = "The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN)"
default = []
}

variable "apply_immediately" {
default = "true"
description = "Apply changes immediately"
Expand Down

0 comments on commit 277a6ed

Please sign in to comment.