Skip to content

Commit 2afad72

Browse files
Scott WinklerScott Winkler
authored andcommitted
update
1 parent fd22e6e commit 2afad72

File tree

9 files changed

+28
-33
lines changed

9 files changed

+28
-33
lines changed

modules/cluster/main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ locals {
1111
instance_count = var.instance_count,
1212
namespace = var.namespace,
1313
datacenter = var.datacenter,
14-
join_wan = join(",",[for s in var.join_wan: join("",["\"",s,"\""])]),
14+
join_wan = join(",", [for s in var.join_wan : join("", ["\"", s, "\""])]),
1515
}) : ""
1616
nomad_config = var.nomad.mode != "disabled" ? templatefile("${path.module}/templates/nomad_${var.nomad.mode}.hcl", {
1717
instance_count = var.instance_count
@@ -49,8 +49,8 @@ resource "aws_launch_template" "server" {
4949
}
5050
network_interfaces {
5151
associate_public_ip_address = var.associate_public_ips
52-
security_groups = [var.security_group_id]
53-
delete_on_termination = true
52+
security_groups = [var.security_group_id]
53+
delete_on_termination = true
5454
}
5555

5656
tags = {
@@ -87,10 +87,10 @@ resource "aws_autoscaling_group" "server" {
8787

8888
data "aws_instances" "instances" {
8989
depends_on = [aws_autoscaling_group.server]
90-
count = var.associate_public_ips ? 1 : 0
90+
count = var.associate_public_ips ? 1 : 0
9191
instance_tags = {
9292
ResourceGroup = var.namespace
93-
Name = local.namespace
93+
Name = local.namespace
9494
}
9595

9696
instance_state_names = ["running", "pending"]

modules/cluster/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
output "public_ips" {
2-
value = var.associate_public_ips&&length(data.aws_instances.instances)>=1 ? data.aws_instances.instances[0].public_ips : []
2+
value = var.associate_public_ips && length(data.aws_instances.instances) >= 1 ? data.aws_instances.instances[0].public_ips : []
33
}

modules/loadbalancing/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ resource "aws_lb_listener" "nomad_ui" {
7878

7979
//fabio load balancer
8080
resource "aws_lb" "fabio_lb" {
81-
name = "${var.namespace}-fabio"
82-
internal = false
83-
subnets = var.vpc.public_subnets
81+
name = "${var.namespace}-fabio"
82+
internal = false
83+
subnets = var.vpc.public_subnets
8484
load_balancer_type = "network"
8585
}
8686

@@ -93,7 +93,7 @@ resource "aws_lb_target_group" "fabio_ui" {
9393
health_check {
9494
port = 4646
9595
}
96-
96+
9797
tags = {
9898
ResourceGroup = var.namespace
9999
}

modules/loadbalancing/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ variable "namespace" {
33
}
44

55
variable "vpc" {
6-
type = any
6+
type = any
77
}
88

99
variable "sg" {

modules/networking/main.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
data "aws_availability_zones" "available" {}
22

33
module "vpc" {
4-
source = "terraform-aws-modules/vpc/aws"
5-
version = "2.70.0"
6-
name = "${var.namespace}-vpc"
7-
cidr = "10.0.0.0/16"
8-
azs = data.aws_availability_zones.available.names
9-
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
10-
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
11-
enable_nat_gateway = true
12-
single_nat_gateway = true
4+
source = "terraform-aws-modules/vpc/aws"
5+
version = "2.70.0"
6+
name = "${var.namespace}-vpc"
7+
cidr = "10.0.0.0/16"
8+
azs = data.aws_availability_zones.available.names
9+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
10+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
11+
enable_nat_gateway = true
12+
single_nat_gateway = true
1313
tags = {
1414
ResourceGroup = var.namespace
1515
}

modules/resourcegroup/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
output "namespace" {
2-
value = local.namespace
2+
value = local.namespace
33
}

modules/resourcegroup/variable.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
variable "namespace" {
2-
type = string
2+
type = string
33
}

outputs.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
output "addresses" {
2-
value = module.loadbalancing.addresses
2+
value = module.loadbalancing.addresses
33
}
44

55
output "public_ips" {
6-
value = {
7-
consul_servers = module.consul_servers.public_ips
8-
nomad_servers = module.nomad_servers.public_ips
9-
}
6+
value = {
7+
consul_servers = module.consul_servers.public_ips
8+
nomad_servers = module.nomad_servers.public_ips
9+
}
1010
}

variables.tf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ variable "nomad" {
2828
})
2929
}
3030

31-
variable "region" {
32-
default = "us-west-2"
33-
type = string
34-
}
35-
3631
variable "namespace" {
3732
default = "terraforminaction"
3833
type = string
@@ -55,5 +50,5 @@ variable "join_wan" {
5550

5651
variable "associate_public_ips" {
5752
default = true
58-
type = bool
53+
type = bool
5954
}

0 commit comments

Comments
 (0)