Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
carlssonk committed Sep 26, 2024
1 parent a8322b7 commit 4a0b4df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions common/services/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion common/services/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
output "policy_documents" {
value = [
try(module.service_discovery_namespace[0].policy_document, null),
try(module.ec2_instance_nginx[0].policy_document, null),
try(module.ec2_instance_nginx_proxy[0].policy_document, null),
try(module.ec2_instance_nginx_eip[0].policy_document, null),
try(module.main_alb[0].policy_document, null),
try(module.main_alb_access_logs_bucket[0].policy_document, null),
Expand Down

0 comments on commit 4a0b4df

Please sign in to comment.