Skip to content

Commit 3943888

Browse files
Merge branch 'workflows-fix' into staging
2 parents 9eef1fc + ae1d842 commit 3943888

9 files changed

Lines changed: 64 additions & 2 deletions
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
resource "terraform_data" "install_lz4" {
2+
depends_on = [aws_instance.ethereum]
3+
4+
connection {
5+
type = "ssh"
6+
user = var.ethereum_node.user
7+
port = var.ethereum_node.ssh_port
8+
host = aws_instance.ethereum.public_ip
9+
private_key = file("${path.module}/ethereum.pem")
10+
}
11+
12+
provisioner "remote-exec" {
13+
inline = [
14+
"sudo apt-get update -y",
15+
"sudo apt-get install -y lz4"
16+
]
17+
}
18+
}

terraform/ethereum_ec2_instance.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ resource "aws_instance" "ethereum" {
5050
vpc_security_group_ids = [
5151
local.vpc_default_security_group_id,
5252
aws_security_group.ethereum_ssh.id,
53-
aws_security_group.ethereum_nginx.id
53+
aws_security_group.ethereum_nginx.id,
54+
aws_security_group.ethereum_public_p2p.id,
55+
aws_security_group.lighthouse_public_p2p.id
5456
]
5557
}

terraform/ethereum_ec2_public_ip.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ resource "aws_eip" "ethereum" {
1010
output "ethereum_ssh_connect" {
1111
value = "ssh -p ${var.ethereum_node.ssh_port} -i ${path.module}/ethereum.pem -o IdentitiesOnly=yes ${var.ethereum_node.user}@${aws_eip.ethereum.public_ip}"
1212
description = "SSH command to connect to the Ethereum EC2 instance"
13-
sensitive = true
13+
sensitive = false
1414
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
resource "aws_cloudwatch_metric_alarm" "ethereum_lb_unhealthy_host_count" {
2+
alarm_name = "${var.project}_${var.environment}_ethereum_lb_unhealthy_host_count"
3+
alarm_description = "Watches for Ethereum Load Balancer Unhealthy Host Count"
4+
5+
comparison_operator = "GreaterThanThreshold"
6+
evaluation_periods = "1"
7+
datapoints_to_alarm = 1
8+
9+
metric_name = "UnHealthyHostCount"
10+
namespace = "AWS/ApplicationELB"
11+
period = "60"
12+
statistic = "Minimum"
13+
threshold = "0"
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+
TargetGroup = aws_lb_target_group.ethereum_nginx.arn_suffix
28+
LoadBalancer = aws_lb.main.arn_suffix
29+
}
30+
31+
tags = {
32+
"Name" = "${var.project}_${var.environment}_ethereum_lb_unhealthy_host_count"
33+
}
34+
}

terraform/ethereum_nginx_cloudwatch_logs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ resource "aws_cloudwatch_log_group" "ethereum_nginx_access" {
22
name = "${var.project}-${var.environment}-ethereum-nginx-access"
33
retention_in_days = var.nginx.cloudwatch_logs_retention_in_days
44

5+
depends_on = [terraform_data.nginx_configuration]
6+
57
tags = {
68
"Name" = "${var.project}-${var.environment}-ethereum-nginx-access"
79
}
@@ -11,6 +13,8 @@ resource "aws_cloudwatch_log_group" "ethereum_nginx_error" {
1113
name = "${var.project}-${var.environment}-ethereum-nginx-error"
1214
retention_in_days = var.nginx.cloudwatch_logs_retention_in_days
1315

16+
depends_on = [terraform_data.nginx_configuration]
17+
1418
tags = {
1519
"Name" = "${var.project}-${var.environment}-ethereum-nginx-error"
1620
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ethereum_ec2_install_lz4.tf
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ethereum_lb_unhealthy_host_count_alarm.tf
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ethereum_ec2_install_lz4.tf
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ethereum_lb_unhealthy_host_count_alarm.tf

0 commit comments

Comments
 (0)