Skip to content

Commit 940aad1

Browse files
authored
Merge branch 'techiescamp:master' into master
2 parents 7f571e3 + 17762df commit 940aad1

File tree

8 files changed

+519
-121
lines changed

8 files changed

+519
-121
lines changed

.github/workflows/rds.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

environments/dev/lb-asg/main.tf

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,46 @@ provider "aws" {
33
}
44

55
module "lb-asg" {
6-
source = "../../../modules/lb-asg"
7-
region = var.region
8-
owner = var.owner
9-
cost_center = var.cost_center
10-
subnets = var.subnets
11-
ami_id = var.ami_id
12-
instance_type = var.instance_type
13-
key_name = var.key_name
14-
environment = var.environment
15-
vpc_id = var.vpc_id
6+
source = "../../../modules/lb-asg"
7+
region = var.region
8+
instance_profile = var.instance_profile
9+
instance_role = var.instance_role
10+
lb_from_port = var.lb_from_port
11+
lb_to_port = var.lb_to_port
12+
lb_protocol = var.lb_protocol
13+
lb_cidr_block = var.lb_cidr_block
14+
internal = var.internal
15+
lb_type = var.lb_type
16+
instance_from_port = var.instance_from_port
17+
instance_to_port = var.instance_to_port
18+
instance_protocol = var.instance_protocol
19+
instance_cidr_block = var.instance_cidr_block
20+
target_group_port = var.target_group_port
21+
target_group_protocol = var.target_group_protocol
22+
target_type = var.target_type
23+
load_balancing_algorithm = var.load_balancing_algorithm
24+
health_check_path = var.health_check_path
25+
health_check_port = var.health_check_port
26+
health_check_protocol = var.health_check_protocol
27+
health_check_interval = var.health_check_interval
28+
health_check_timeout = var.health_check_timeout
29+
health_check_healthy_treshold = var.health_check_healthy_treshold
30+
health_check_unhealthy_treshold = var.health_check_unhealthy_treshold
31+
listener_port = var.listener_port
32+
listener_protocol = var.listener_protocol
33+
listener_type = var.listener_type
34+
ami_id = var.ami_id
35+
instance_type = var.instance_type
36+
key_name = var.key_name
37+
vpc_id = var.vpc_id
38+
subnets = var.subnets
39+
public_access = var.public_access
40+
user_data = var.user_data
41+
max_size = var.max_size
42+
min_size = var.min_size
43+
desired_capacity = var.desired_capacity
44+
owner = var.owner
45+
environment = var.environment
46+
cost_center = var.cost_center
47+
application = var.application
1648
}

environments/dev/lb-asg/outputs.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
output "load_balancer_dns_name" {
2+
description = "LoadBalancer dns name"
3+
value = module.lb-asg.load_balancer_dns_name
4+
}
5+
6+
output "auto_scaling_group_name" {
7+
description = "Auto scaling group name"
8+
value = module.lb-asg.auto_scaling_group_name
9+
}
10+
11+
output "launch_template_id" {
12+
description = " launch template id"
13+
value = module.lb-asg.launch_template_id
14+
}

environments/dev/lb-asg/variables.tf

Lines changed: 168 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,154 @@ variable "region" {
99
description = "Region of the lb-asg"
1010
}
1111

12+
variable "instance_profile" {
13+
description = "Instance profile for the instance which the instance role is associated with"
14+
type = string
15+
}
16+
17+
variable "instance_role" {
18+
description = "Instance role for the instance"
19+
type = string
20+
}
21+
22+
variable "lb_from_port" {
23+
description = "Load balancer from port"
24+
type = number
25+
}
26+
27+
variable "lb_to_port" {
28+
description = "Load balancer to port"
29+
type = number
30+
}
31+
32+
variable "lb_protocol" {
33+
description = "Load balancer protocol"
34+
type = string
35+
}
36+
37+
variable "lb_cidr_block" {
38+
description = "Load balancer CIDR block"
39+
type = list(string)
40+
}
41+
42+
variable "internal" {
43+
description = "Whether the load balancer is internal or not"
44+
type = bool
45+
}
46+
47+
variable "lb_type" {
48+
description = "Load balancer type"
49+
type = string
50+
}
51+
52+
variable "instance_from_port" {
53+
description = "Instance from port"
54+
type = number
55+
}
56+
57+
variable "instance_to_port" {
58+
description = "Instance to port"
59+
type = number
60+
}
61+
62+
variable "instance_protocol" {
63+
description = "Instance protocol"
64+
type = string
65+
}
66+
67+
variable "instance_cidr_block" {
68+
description = "Instance CIDR block"
69+
type = list(string)
70+
}
71+
72+
variable "target_group_port" {
73+
description = "Target group port"
74+
type = number
75+
}
76+
77+
variable "target_group_protocol" {
78+
description = "Target group protocol"
79+
type = string
80+
}
81+
82+
variable "target_type" {
83+
description = "Target type"
84+
type = string
85+
}
86+
87+
variable "load_balancing_algorithm" {
88+
description = "Specify the load balancing algorithm type"
89+
type = string
90+
}
91+
92+
variable "health_check_path" {
93+
description = "Health check path"
94+
type = string
95+
}
96+
97+
variable "health_check_port" {
98+
description = "Health check port"
99+
type = number
100+
}
101+
102+
variable "health_check_protocol" {
103+
description = "Health check protocol"
104+
type = string
105+
}
106+
107+
variable "health_check_interval" {
108+
description = "Health check interval"
109+
type = number
110+
}
111+
112+
variable "health_check_timeout" {
113+
description = "Health check timeout"
114+
type = number
115+
}
116+
117+
variable "health_check_healthy_treshold" {
118+
description = "Health check healthy threshold"
119+
type = number
120+
}
121+
122+
variable "health_check_unhealthy_treshold" {
123+
description = "Health check unhealthy threshold"
124+
type = number
125+
}
126+
127+
variable "listener_port" {
128+
description = "Listener port"
129+
type = number
130+
}
131+
132+
variable "listener_protocol" {
133+
description = "Listener protocol"
134+
type = string
135+
}
136+
137+
variable "listener_type" {
138+
description = "Listener type"
139+
type = string
140+
}
141+
142+
12143
variable "ami_id" {
144+
type = string
13145
description = "The ID of the Amazon Machine Image (AMI) to use for the EC2 instances."
14146
}
15147

16148
variable "instance_type" {
149+
type = string
17150
description = "The type of EC2 instance to use for the ASG."
18151
}
19152

20153
variable "key_name" {
154+
type = string
21155
description = "The name of the EC2 key pair to use for the instances."
22156
}
23157

24-
variable "environment" {
25-
description = "The environment name for the resources."
26-
}
27-
28158
variable "vpc_id" {
159+
type = string
29160
description = "The ID of the VPC to use for the resources."
30161
}
31162

@@ -34,18 +165,47 @@ variable "subnets" {
34165
type = list(string)
35166
}
36167

37-
variable "iam_role_arn" {
38-
description = "ARN of the existing IAM role"
168+
variable "public_access" {
169+
description = "Whether the instance is public or not"
170+
type = bool
171+
}
172+
173+
variable "user_data" {
174+
description = "user data script"
39175
type = string
40-
default = null
176+
}
177+
178+
variable "max_size" {
179+
description = "Maximum size of something"
180+
type = number
181+
}
182+
183+
variable "min_size" {
184+
description = "Minimum size of something"
185+
type = number
186+
}
187+
188+
variable "desired_capacity" {
189+
description = "Desired capacity of something"
190+
type = number
41191
}
42192

43193
variable "owner" {
44194
type = string
45-
description = "Name of owner this lb-asg is meant to house"
195+
description = "Name of owner"
196+
}
197+
198+
variable "environment" {
199+
type = string
200+
description = "The environment name for the resources."
46201
}
47202

48203
variable "cost_center" {
49204
type = string
50205
description = "Name of cost-center for this lb-asg"
51206
}
207+
208+
variable "application" {
209+
type = string
210+
description = "Name of the application"
211+
}

0 commit comments

Comments
 (0)