Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging #1803

Closed
wants to merge 1 commit into from
Closed

Tagging #1803

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion terraform/modules/aws/alarms/alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list` | `[]` | no |
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list(string)` | `[]` | no |
| <a name="input_alb_arn_suffix"></a> [alb\_arn\_suffix](#input\_alb\_arn\_suffix) | The ALB ARN suffix for use with CloudWatch Metrics. | `string` | n/a | yes |
| <a name="input_httpcode_elb_4xx_count_threshold"></a> [httpcode\_elb\_4xx\_count\_threshold](#input\_httpcode\_elb\_4xx\_count\_threshold) | The value against which the HTTPCode\_ELB\_4XX\_Count metric is compared. | `string` | `"0"` | no |
| <a name="input_httpcode_elb_5xx_count_threshold"></a> [httpcode\_elb\_5xx\_count\_threshold](#input\_httpcode\_elb\_5xx\_count\_threshold) | The value against which the HTTPCode\_ELB\_5XX\_Count metric is compared. | `string` | `"80"` | no |
Expand Down
38 changes: 19 additions & 19 deletions terraform/modules/aws/alarms/alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,124 +19,124 @@
* http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/elb-metricscollected.html#load-balancer-metric-dimensions-alb
*/
variable "name_prefix" {
type = "string"
type = string
description = "The alarm name prefix."
}

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

variable "alb_arn_suffix" {
type = "string"
type = string
description = "The ALB ARN suffix for use with CloudWatch Metrics."
}

variable "httpcode_target_4xx_count_threshold" {
type = "string"
type = string
description = "The value against which the HTTPCode_Target_4XX_Count metric is compared."
default = "0"
}

variable "httpcode_target_5xx_count_threshold" {
type = "string"
type = string
description = "The value against which the HTTPCode_Target_5XX_Count metric is compared."
default = "80"
}

variable "httpcode_elb_4xx_count_threshold" {
type = "string"
type = string
description = "The value against which the HTTPCode_ELB_4XX_Count metric is compared."
default = "0"
}

variable "httpcode_elb_5xx_count_threshold" {
type = "string"
type = string
description = "The value against which the HTTPCode_ELB_5XX_Count metric is compared."
default = "80"
}

# Resources
#--------------------------------------------------------------
resource "aws_cloudwatch_metric_alarm" "elb_httpcode_elb_4xx_count" {
count = "${var.httpcode_elb_4xx_count_threshold > 0 ? 1 : 0}"
count = var.httpcode_elb_4xx_count_threshold > 0 ? 1 : 0
alarm_name = "${var.name_prefix}-elb-httpcode_elb_4xx_count"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "5"
metric_name = "HTTPCode_ELB_4XX_Count"
namespace = "AWS/ApplicationELB"
period = "60"
statistic = "Sum"
threshold = "${var.httpcode_elb_4xx_count_threshold}"
threshold = var.httpcode_elb_4xx_count_threshold
actions_enabled = true
alarm_actions = ["${var.alarm_actions}"]
alarm_description = "This metric monitors the sum of HTTP 4XX response codes generated by the Application LB."
treat_missing_data = "notBreaching"

dimensions {
LoadBalancer = "${var.alb_arn_suffix}"
LoadBalancer = var.alb_arn_suffix
}
}

resource "aws_cloudwatch_metric_alarm" "elb_httpcode_elb_5xx_count" {
count = "${var.httpcode_elb_5xx_count_threshold > 0 ? 1 : 0}"
count = var.httpcode_elb_5xx_count_threshold > 0 ? 1 : 0
alarm_name = "${var.name_prefix}-elb-httpcode_elb_5xx_count"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "5"
metric_name = "HTTPCode_ELB_5XX_Count"
namespace = "AWS/ApplicationELB"
period = "60"
statistic = "Sum"
threshold = "${var.httpcode_elb_5xx_count_threshold}"
threshold = var.httpcode_elb_5xx_count_threshold
actions_enabled = true
alarm_actions = ["${var.alarm_actions}"]
alarm_description = "This metric monitors the sum of HTTP 5XX response codes generated by the Application LB."
treat_missing_data = "notBreaching"

dimensions {
LoadBalancer = "${var.alb_arn_suffix}"
LoadBalancer = var.alb_arn_suffix
}
}

resource "aws_cloudwatch_metric_alarm" "elb_httpcode_target_4xx_count" {
count = "${var.httpcode_target_4xx_count_threshold > 0 ? 1 : 0}"
count = var.httpcode_target_4xx_count_threshold > 0 ? 1 : 0
alarm_name = "${var.name_prefix}-elb-httpcode_target_4xx_count"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "5"
metric_name = "HTTPCode_Target_4XX_Count"
namespace = "AWS/ApplicationELB"
period = "60"
statistic = "Sum"
threshold = "${var.httpcode_target_4xx_count_threshold}"
threshold = var.httpcode_target_4xx_count_threshold
actions_enabled = true
alarm_actions = ["${var.alarm_actions}"]
alarm_description = "This metric monitors the sum of HTTP 4XX response codes generated by the Target Groups."
treat_missing_data = "notBreaching"

dimensions {
LoadBalancer = "${var.alb_arn_suffix}"
LoadBalancer = var.alb_arn_suffix
}
}

resource "aws_cloudwatch_metric_alarm" "elb_httpcode_target_5xx_count" {
count = "${var.httpcode_target_5xx_count_threshold > 0 ? 1 : 0}"
count = var.httpcode_target_5xx_count_threshold > 0 ? 1 : 0
alarm_name = "${var.name_prefix}-elb-httpcode_target_5xx_count"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "5"
metric_name = "HTTPCode_Target_5XX_Count"
namespace = "AWS/ApplicationELB"
period = "60"
statistic = "Sum"
threshold = "${var.httpcode_target_5xx_count_threshold}"
threshold = var.httpcode_target_5xx_count_threshold
actions_enabled = true
alarm_actions = ["${var.alarm_actions}"]
alarm_description = "This metric monitors the sum of HTTP 5XX response codes generated by the Target Groups."
treat_missing_data = "notBreaching"

dimensions {
LoadBalancer = "${var.alb_arn_suffix}"
LoadBalancer = var.alb_arn_suffix
}
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/aws/alarms/autoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list` | n/a | yes |
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list(string)` | n/a | yes |
| <a name="input_autoscaling_group_name"></a> [autoscaling\_group\_name](#input\_autoscaling\_group\_name) | The name of the AutoScalingGroup that we want to monitor. | `string` | n/a | yes |
| <a name="input_groupinserviceinstances_threshold"></a> [groupinserviceinstances\_threshold](#input\_groupinserviceinstances\_threshold) | The value against which the Autoscaling GroupInServiceInstaces metric is compared. | `string` | `"1"` | no |
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | The alarm name prefix. | `string` | n/a | yes |
Expand Down
12 changes: 6 additions & 6 deletions terraform/modules/aws/alarms/autoscaling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
*
*/
variable "name_prefix" {
type = "string"
type = string
description = "The alarm name prefix."
}

variable "groupinserviceinstances_threshold" {
type = "string"
type = string
description = "The value against which the Autoscaling GroupInServiceInstaces metric is compared."
default = "1"
}

variable "alarm_actions" {
type = "list"
type = list(string)
description = "The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN)."
}

variable "autoscaling_group_name" {
type = "string"
type = string
description = "The name of the AutoScalingGroup that we want to monitor."
}

Expand All @@ -45,7 +45,7 @@ resource "aws_cloudwatch_metric_alarm" "autoscaling_groupinserviceinstances" {
namespace = "AWS/AutoScaling"
period = "60"
statistic = "Average"
threshold = "${var.groupinserviceinstances_threshold}"
threshold = var.groupinserviceinstances_threshold
actions_enabled = true
alarm_actions = var.alarm_actions
alarm_description = "This metric monitors instances in service in an AutoScalingGroup"
Expand All @@ -60,6 +60,6 @@ resource "aws_cloudwatch_metric_alarm" "autoscaling_groupinserviceinstances" {

// The ID of the autoscaling GroupInServiceInstances health check.
output "alarm_autoscaling_groupinserviceinstances_id" {
value = "${aws_cloudwatch_metric_alarm.autoscaling_groupinserviceinstances.id}"
value = aws_cloudwatch_metric_alarm.autoscaling_groupinserviceinstances.id
description = "The ID of the autoscaling GroupInServiceInstances health check."
}
2 changes: 1 addition & 1 deletion terraform/modules/aws/alarms/ebs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list` | n/a | yes |
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list(string)` | n/a | yes |
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | The alarm name prefix. | `string` | n/a | yes |
| <a name="input_volume_id"></a> [volume\_id](#input\_volume\_id) | The ID of the EBS volume that we want to monitor. | `string` | n/a | yes |
| <a name="input_volumequeuelength_threshold"></a> [volumequeuelength\_threshold](#input\_volumequeuelength\_threshold) | The value against which the EBS VolumeQueueLength metric is compared. | `string` | `"10"` | no |
Expand Down
14 changes: 7 additions & 7 deletions terraform/modules/aws/alarms/ebs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
* http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ebs-metricscollected.html
*/
variable "name_prefix" {
type = "string"
type = string
description = "The alarm name prefix."
}

variable "volumequeuelength_threshold" {
type = "string"
type = string
description = "The value against which the EBS VolumeQueueLength metric is compared."
default = "10"
}

variable "alarm_actions" {
type = "list"
type = list(string)
description = "The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN)."
}

variable "volume_id" {
type = "string"
type = string
description = "The ID of the EBS volume that we want to monitor."
}

Expand All @@ -44,13 +44,13 @@ resource "aws_cloudwatch_metric_alarm" "ebs_volumequeuelength" {
namespace = "AWS/EBS"
period = "120"
statistic = "Average"
threshold = "${var.volumequeuelength_threshold}"
threshold = var.volumequeuelength_threshold
actions_enabled = true
alarm_actions = ["${var.alarm_actions}"]
alarm_description = "This metric monitors the number of read and write operation requests waiting to be completed in an EBS volume"

dimensions {
VolumeId = "${var.volume_id}"
VolumeId = var.volume_id
}
}

Expand All @@ -59,6 +59,6 @@ resource "aws_cloudwatch_metric_alarm" "ebs_volumequeuelength" {

// The ID of the EBS VolumeQueueLength health check.
output "alarm_ebs_volumequeuelength_id" {
value = "${aws_cloudwatch_metric_alarm.ebs_volumequeuelength.id}"
value = aws_cloudwatch_metric_alarm.ebs_volumequeuelength.id
description = "The ID of the EBS VolumeQueueLength health check."
}
2 changes: 1 addition & 1 deletion terraform/modules/aws/alarms/ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list` | n/a | yes |
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list(string)` | n/a | yes |
| <a name="input_autoscaling_group_name"></a> [autoscaling\_group\_name](#input\_autoscaling\_group\_name) | The name of the AutoScalingGroup that we want to monitor. | `string` | n/a | yes |
| <a name="input_cpuutilization_threshold"></a> [cpuutilization\_threshold](#input\_cpuutilization\_threshold) | The value against which the CPUUtilization metric is compared, in percent. | `string` | `"80"` | no |
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | The alarm name prefix. | `string` | n/a | yes |
Expand Down
14 changes: 7 additions & 7 deletions terraform/modules/aws/alarms/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
* http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html
*/
variable "name_prefix" {
type = "string"
type = string
description = "The alarm name prefix."
}

variable "cpuutilization_threshold" {
type = "string"
type = string
description = "The value against which the CPUUtilization metric is compared, in percent."
default = "80"
}

variable "alarm_actions" {
type = "list"
type = list(string)
description = "The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN)."
}

variable "autoscaling_group_name" {
type = "string"
type = string
description = "The name of the AutoScalingGroup that we want to monitor."
}

Expand All @@ -47,7 +47,7 @@ resource "aws_cloudwatch_metric_alarm" "ec2_cpuutilization" {
namespace = "AWS/EC2"
period = "120"
statistic = "Average"
threshold = "${var.cpuutilization_threshold}"
threshold = var.cpuutilization_threshold
actions_enabled = true
alarm_actions = var.alarm_actions
alarm_description = "This metric monitors CPU utilization in an instance"
Expand Down Expand Up @@ -80,12 +80,12 @@ resource "aws_cloudwatch_metric_alarm" "ec2_statuscheckfailed_instance" {

// The ID of the instance CPUUtilization health check.
output "alarm_ec2_cpuutilization_id" {
value = "${aws_cloudwatch_metric_alarm.ec2_cpuutilization.id}"
value = aws_cloudwatch_metric_alarm.ec2_cpuutilization.id
description = "The ID of the instance CPUUtilization health check."
}

// The ID of the instance StatusCheckFailed_Instance health check.
output "alarm_ec2_statuscheckfailed_instance_id" {
value = "${aws_cloudwatch_metric_alarm.ec2_statuscheckfailed_instance.id}"
value = aws_cloudwatch_metric_alarm.ec2_statuscheckfailed_instance.id
description = "The ID of the instance StatusCheckFailed_Instance health check."
}
2 changes: 1 addition & 1 deletion terraform/modules/aws/alarms/elb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list` | n/a | yes |
| <a name="input_alarm_actions"></a> [alarm\_actions](#input\_alarm\_actions) | The list of actions to execute when this alarm transitions into an ALARM state. Each action is specified as an Amazon Resource Number (ARN). | `list(string)` | n/a | yes |
| <a name="input_elb_name"></a> [elb\_name](#input\_elb\_name) | The name of the ELB that we want to monitor. | `string` | n/a | yes |
| <a name="input_healthyhostcount_threshold"></a> [healthyhostcount\_threshold](#input\_healthyhostcount\_threshold) | The value against which the HealthyHostCount metric is compared. | `string` | `"0"` | no |
| <a name="input_httpcode_backend_4xx_threshold"></a> [httpcode\_backend\_4xx\_threshold](#input\_httpcode\_backend\_4xx\_threshold) | The value against which the HTTPCode\_Backend\_4XX metric is compared. | `string` | `"80"` | no |
Expand Down
Loading