From f879b96d536a728d7e077dabed3cafcba4246904 Mon Sep 17 00:00:00 2001 From: Henry Boisgibault Date: Thu, 28 Oct 2021 15:45:40 +0200 Subject: [PATCH] Bug fixes and improvements --- autoscaling.tf | 6 ++++++ security_group.tf | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/autoscaling.tf b/autoscaling.tf index b69e461..046f997 100644 --- a/autoscaling.tf +++ b/autoscaling.tf @@ -80,6 +80,12 @@ resource "aws_autoscaling_group" "main_asg" { ignore_changes = [desired_capacity] } + tag { + key = "Name" + value = var.environment_name + propagate_at_launch = true + } + tag { key = "AmazonECSManaged" value = "" diff --git a/security_group.tf b/security_group.tf index 37989fa..1913143 100644 --- a/security_group.tf +++ b/security_group.tf @@ -39,12 +39,12 @@ data "aws_security_group" "target_sg" { } resource "aws_security_group_rule" "ingress_traffic" { - for_each = data.aws_security_group.target_sg + count = length(data.aws_security_group.target_sg) type = "ingress" from_port = 0 to_port = 65535 protocol = "tcp" source_security_group_id = aws_security_group.main_sg.id prefix_list_ids = [] - security_group_id = each.id + security_group_id = data.aws_security_group.target_sg[count.index].id } \ No newline at end of file