diff --git a/CHANGELOG/2020-08-20-master.yml b/CHANGELOG/2020-08-20-master.yml new file mode 100644 index 0000000..47fa716 --- /dev/null +++ b/CHANGELOG/2020-08-20-master.yml @@ -0,0 +1,4 @@ +- type: changed + m: Change names for LB,launch_template,target_group,ASG + jira: PLAT-5132 + owner: mwieczorek diff --git a/load_balancer.tf b/load_balancer.tf index 74d1317..676f98e 100644 --- a/load_balancer.tf +++ b/load_balancer.tf @@ -3,7 +3,7 @@ ####################################################### resource "aws_lb" "bastion-service" { - name = md5(format("${var.service_name}-%s", var.vpc)) + name = "${var.service_name}-${var.environment_name}" load_balancer_type = "network" internal = var.lb_is_internal subnets = var.subnets_lb @@ -46,7 +46,7 @@ resource "aws_lb_listener" "bastion-host" { # Target group service ####################################################### resource "aws_lb_target_group" "bastion-service" { - name = md5(format("${var.service_name}-%s", var.vpc)) + name = "${var.service_name}-${var.environment_name}-22" protocol = "TCP" port = 22 vpc_id = var.vpc @@ -67,7 +67,7 @@ resource "aws_lb_target_group" "bastion-service" { ####################################################### resource "aws_lb_target_group" "bastion-host" { count = local.hostport_whitelisted ? 1 : 0 - name = md5(format("${var.bastion_host_name}-%s", var.vpc)) + name = "${var.service_name}-${var.environment_name}-22" protocol = "TCP" port = 2222 vpc_id = var.vpc @@ -82,4 +82,3 @@ resource "aws_lb_target_group" "bastion-host" { tags = var.tags } - diff --git a/main.tf b/main.tf index 4b34ac6..c08eccb 100755 --- a/main.tf +++ b/main.tf @@ -27,7 +27,7 @@ data "aws_ami" "debian" { ############################ resource "aws_launch_template" "bastion-service-host" { - name_prefix = "${var.service_name}-host" + name_prefix = "${var.service_name}-host-${var.environment_name}" image_id = local.bastion_ami_id instance_type = var.bastion_instance_types[0] key_name = var.bastion_service_host_key_name @@ -94,7 +94,7 @@ data "null_data_source" "asg-tags" { resource "aws_autoscaling_group" "bastion-service" { availability_zones = data.aws_availability_zones.available.names - name_prefix = "${var.service_name}-asg" + name_prefix = "${var.service_name}-asg-${var.environment_name}" max_size = var.asg_max min_size = var.asg_min desired_capacity = var.asg_desired