Skip to content

Commit 438b4eb

Browse files
committed
Add option to create internal load balancer
1 parent 2a401f0 commit 438b4eb

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module "alb" {
99
tags = var.tags
1010
vpc_id = var.vpc_id
1111
enable_access_logs = var.enable_access_logs
12+
internal_alb = var.internal_alb
1213
s3_logs_bucket_name = var.s3_logs_bucket_name
1314
}
1415

modules/alb/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
resource "aws_alb" "this" {
22
name = var.name
3+
internal = var.internal_alb
34
security_groups = [aws_security_group.this.id]
45

56
dynamic "connection_logs" {

modules/alb/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ variable "enable_connection_logs" {
1515
description = "Enable or disable ALB connection logs. If set to true, logs will be stored in an S3 bucket."
1616
}
1717

18+
variable "internal_alb" {
19+
description = "If true, the LB will be internal. Defaults to false"
20+
type = bool
21+
default = false
22+
}
23+
1824
variable "name" {
1925
description = "Name for this load balancer"
2026
type = string

variables.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ variable "issue_certificate_domains" {
6767
type = list(string)
6868
default = []
6969
}
70-
70+
variable "internal_alb" {
71+
description = "If true, the LB will be internal. Defaults to false"
72+
type = bool
73+
default = false
74+
}
7175
variable "legacy_target_group_names" {
7276
description = "Names of legacy target groups which should be included"
7377
type = list(string)

0 commit comments

Comments
 (0)