File tree Expand file tree Collapse file tree 10 files changed +60
-10
lines changed Expand file tree Collapse file tree 10 files changed +60
-10
lines changed Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
Original file line number Diff line number Diff line change @@ -355,20 +355,25 @@ variable "web_instances" {
355
355
"metrics"
356
356
]
357
357
}
358
+
358
359
resource "aws_instance" "web" {
359
360
for_each = toset(var.web_instances)
361
+
360
362
ami = data.aws_ami.webapp.id
361
363
instance_type = "t3.micro"
364
+
362
365
tags = {
363
366
Name = "web_${each.key}"
364
367
}
365
368
}
369
+
366
370
output "web_private_ips" {
367
371
description = "Private IPs of the web instances"
368
372
value = {
369
373
for k, v in aws_instance.web : k => v.private_ip
370
374
}
371
375
}
376
+
372
377
output "web_ui_public_ip" {
373
378
description = "Public IP of the web UI instance"
374
379
value = aws_instance.web["ui"].public_ip
@@ -403,8 +408,8 @@ A common practice to conditionally create resources is to use the `count` meta-a
403
408
404
409
``` hcl
405
410
variable "enable_metrics" {
406
- description = "True if the metrics server should be deployed"
407
411
type = bool
412
+ description = "True if the metrics server should be deployed"
408
413
default = true
409
414
}
410
415
You can’t perform that action at this time.
0 commit comments