-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ data "cloudinit_config" "this" { | |
sudo yum install -y nginx certbot python3-certbot-nginx | ||
# Create nginx config | ||
sudo tee /etc/nginx/nginx.conf <<EOF | ||
sudo tee /etc/nginx/nginx.conf <<'EOF' | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
@@ -94,16 +94,15 @@ data "cloudinit_config" "this" { | |
sudo certbot --nginx -d carlssonk.com -d *.carlssonk.com --non-interactive --agree-tos -m [email protected] | ||
# Ensure Certbot auto-renewal is enabled | ||
sudo systemctl enable certbot.timer | ||
sudo systemctl start certbot.timer | ||
sudo systemctl start certbot-renew.timer | ||
# Restart NGINX to apply changes | ||
sudo systemctl restart nginx | ||
EOT | ||
} | ||
} | ||
|
||
module "ec2_instance_nginx" { | ||
module "ec2_instance_nginx_proxy" { | ||
count = var.reverse_proxy_type == "nginx" ? 1 : 0 | ||
name = "nginx-reverse-proxy" | ||
source = "../../modules/ec2-instance/default" | ||
|
@@ -140,7 +139,7 @@ module "ec2_instance_nginx" { | |
module "ec2_instance_nginx_eip" { | ||
count = var.reverse_proxy_type == "nginx" ? 1 : 0 | ||
source = "../../modules/elastic-ip/default" | ||
instance_id = module.ec2_instance_nginx[0].id | ||
instance_id = module.ec2_instance_nginx_proxy[0].id | ||
} | ||
|
||
module "main_alb_access_logs_bucket" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters