File tree Expand file tree Collapse file tree
modules/l2_op_stack_chains Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module "base_ec2_instance" {
1414 load_balancer = var. load_balancer
1515
1616 node = {
17+ alarm_cpu_threshold_percentage = var.base_node.alarm_cpu_threshold_percentage # 80
1718 alarm_memory_threshold_percentage = var.base_node.alarm_memory_threshold_percentage # 80
1819 alarm_disk_used_threshold_percentage = var.base_node.alarm_disk_used_threshold_percentage # 90
1920 ami_id = var.base_node.ami_id # "ami-0122205e4fe2524d5" # ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-20250821
Original file line number Diff line number Diff line change 1+ resource "aws_cloudwatch_metric_alarm" "ethereum_ec2_cpu_high" {
2+ alarm_name = " ${ var . project } _${ var . environment } _ethereum_ec2_cpu_high"
3+ alarm_description = " Watches for Ethereum EC2 CPU crossing high limit"
4+
5+ comparison_operator = " GreaterThanThreshold"
6+ evaluation_periods = " 3"
7+ datapoints_to_alarm = 3
8+
9+ metric_name = " CPUUtilization"
10+ namespace = " AWS/EC2"
11+ period = " 60"
12+ statistic = " Maximum"
13+ threshold = tostring (var. ethereum_node . alarm_cpu_threshold_percentage )
14+
15+ alarm_actions = [
16+ data . aws_sns_topic . developers_notifications . arn
17+ ]
18+ ok_actions = [
19+ data . aws_sns_topic . developers_notifications . arn
20+ ]
21+
22+ insufficient_data_actions = []
23+
24+ treat_missing_data = " notBreaching"
25+
26+ dimensions = {
27+ InstanceId = aws_instance.ethereum.id
28+ }
29+
30+ tags = {
31+ " Name" = " ${ var . project } _${ var . environment } _ethereum_ec2_cpu_high"
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ resource "aws_cloudwatch_metric_alarm" "ec2_cpu_high" {
2+ alarm_name = " ${ var . project } _${ var . environment } _${ var . node_name } -ec2_cpu_high"
3+ alarm_description = " Watches for EC2 CPU crossing high limit"
4+
5+ comparison_operator = " GreaterThanThreshold"
6+ evaluation_periods = " 3"
7+ datapoints_to_alarm = 3
8+
9+ metric_name = " CPUUtilization"
10+ namespace = " AWS/EC2"
11+ period = " 60"
12+ statistic = " Maximum"
13+ threshold = tostring (var. node . alarm_cpu_threshold_percentage )
14+
15+ alarm_actions = [
16+ data . aws_sns_topic . developers_notifications . arn
17+ ]
18+ ok_actions = [
19+ data . aws_sns_topic . developers_notifications . arn
20+ ]
21+
22+ insufficient_data_actions = []
23+
24+ treat_missing_data = " notBreaching"
25+
26+ dimensions = {
27+ InstanceId = aws_instance.ec2_instance.id
28+ }
29+
30+ tags = {
31+ " Name" = " ${ var . project } _${ var . environment } _${ var . node_name } -ec2_cpu_high"
32+ }
33+ }
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ variable "region" {
3737
3838variable "node" {
3939 type = object ({
40+ alarm_cpu_threshold_percentage = number
4041 alarm_memory_threshold_percentage = number
4142 alarm_disk_used_threshold_percentage = number
4243 ami_id = string
Original file line number Diff line number Diff line change 1+ .. / ethereum_ec2_cpu_alarm. tf
Original file line number Diff line number Diff line change 11ethereum_node = {
2+ alarm_cpu_threshold_percentage = 80
23 alarm_memory_threshold_percentage = 90
34 alarm_disk_used_threshold_percentage = 90
45 ami_id = " ami-0122205e4fe2524d5" # ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-20250821
@@ -41,6 +42,7 @@ load_balancer = {
4142}
4243
4344base_node = {
45+ alarm_cpu_threshold_percentage = 80
4446 alarm_memory_threshold_percentage = 90
4547 alarm_disk_used_threshold_percentage = 90
4648 ami_id = " ami-0122205e4fe2524d5" # ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-20250821
Original file line number Diff line number Diff line change 1+ .. / ethereum_ec2_cpu_alarm. tf
Original file line number Diff line number Diff line change 11ethereum_node = {
2+ alarm_cpu_threshold_percentage = 80
23 alarm_memory_threshold_percentage = 90
34 alarm_disk_used_threshold_percentage = 90
45 ami_id = " ami-0122205e4fe2524d5" # ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-20250821
@@ -8,9 +9,9 @@ ethereum_node = {
89 checkpoint_sync_url = " https://checkpoint-sync.sepolia.ethpandaops.io"
910 ebs_optimized = true
1011 ebs_volume = {
11- size = 3072 # GB, 3TB
12- type = " gp3"
13- iops = 4000
12+ size = 3072 # GB, 3TB
13+ type = " gp3"
14+ iops = 4000
1415 throughput = 250
1516 }
1617 instance_type = " c7g.4xlarge"
@@ -41,6 +42,7 @@ load_balancer = {
4142}
4243
4344base_node = {
45+ alarm_cpu_threshold_percentage = 80
4446 alarm_memory_threshold_percentage = 90
4547 alarm_disk_used_threshold_percentage = 90
4648 ami_id = " ami-0122205e4fe2524d5" # ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-20250821
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ variable "environment" {
3333
3434variable "ethereum_node" {
3535 type = object ({
36+ alarm_cpu_threshold_percentage = number
3637 alarm_memory_threshold_percentage = number
3738 alarm_disk_used_threshold_percentage = number
3839 ami_id = string
@@ -42,9 +43,9 @@ variable "ethereum_node" {
4243 checkpoint_sync_url = string
4344 ebs_optimized = bool
4445 ebs_volume = object ({
45- size = number
46- type = string
47- iops = number
46+ size = number
47+ type = string
48+ iops = number
4849 throughput = number
4950 })
5051 instance_type = string
@@ -108,6 +109,7 @@ variable "load_balancer" {
108109
109110variable "base_node" {
110111 type = object ({
112+ alarm_cpu_threshold_percentage = number
111113 alarm_memory_threshold_percentage = number
112114 alarm_disk_used_threshold_percentage = number
113115 ami_id = string
You can’t perform that action at this time.
0 commit comments