Skip to content

Commit

Permalink
fix: move config to modules-enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
DecFox committed Sep 7, 2024
1 parent 96dbb9e commit 9ea54eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions tf/modules/clickhouse_proxy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data "aws_ssm_parameter" "ubuntu_22_ami" {
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group#recreating-a-security-group
resource "aws_security_group" "ckprx_sg" {
description = "security group for nginx"
name_prefix = "ooni-clickhouse"
name_prefix = "ooni-ckprx"

vpc_id = var.vpc_id

Expand Down Expand Up @@ -66,6 +66,7 @@ resource "aws_launch_template" "clickhouse_proxy" {
network_interfaces {
delete_on_termination = true
associate_public_ip_address = true
subnet_id = var.subnet_id
security_groups = [
aws_security_group.ckprx_sg.id,
]
Expand All @@ -82,14 +83,12 @@ resource "aws_instance" "clickhouse_proxy" {
id = aws_launch_template.clickhouse_proxy.id
version = "$Latest"
}

subnet_id = var.subnet_id

lifecycle {
create_before_destroy = true
}

tags = merge(var.tags, { Name = "ansible-controller" })
tags = merge(var.tags, { Name = "clickhouse-proxy" })
}

resource "aws_route53_record" "clickhouse_proxy_alias" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ stream {
listen 9000;
proxy_pass clickhouse_backend;
}
}
error_log /var/log/nginx/error.log;
}
EOF
sudo mv $tmpfile /etc/nginx/sites-available/default
sudo mv $tmpfile /etc/nginx/modules-enabled/stream.conf

sudo nginx -t
sudo systemctl reload nginx

0 comments on commit 9ea54eb

Please sign in to comment.