Skip to content

Commit

Permalink
Merge pull request #17 from getndazn/names-changes
Browse files Browse the repository at this point in the history
Change names for LB,launch_template,target_group,ASG
  • Loading branch information
Michał Wieczorek authored Aug 20, 2020
2 parents e4fb0fb + 3ca77ac commit 06f84a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG/2020-08-20-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- type: changed
m: Change names for LB,launch_template,target_group,ASG
jira: PLAT-5132
owner: mwieczorek
7 changes: 3 additions & 4 deletions load_balancer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -82,4 +82,3 @@ resource "aws_lb_target_group" "bastion-host" {

tags = var.tags
}

4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 06f84a0

Please sign in to comment.