Skip to content

Commit 672b546

Browse files
Add option to create internal load balancer (#35)
* Add option to create internal load balancer * terraform-docs: automated action --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 2a401f0 commit 672b546

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ module "ingress" {
223223
| <a name="input_enable_stickiness"></a> [enable\_stickiness](#input\_enable\_stickiness) | Set to true to use a cookie for load balancer stickiness | `bool` | `false` | no |
224224
| <a name="input_failure_threshold"></a> [failure\_threshold](#input\_failure\_threshold) | Percentage of failed requests considered an anomaly | `number` | `5` | no |
225225
| <a name="input_hosted_zone_name"></a> [hosted\_zone\_name](#input\_hosted\_zone\_name) | Hosted zone for AWS Route53 | `string` | `null` | no |
226+
| <a name="input_internal_alb"></a> [internal\_alb](#input\_internal\_alb) | If true, the LB will be internal. Defaults to false | `bool` | `false` | no |
226227
| <a name="input_issue_certificate_domains"></a> [issue\_certificate\_domains](#input\_issue\_certificate\_domains) | List of domains for which certificates should be issued | `list(string)` | `[]` | no |
227228
| <a name="input_legacy_target_group_names"></a> [legacy\_target\_group\_names](#input\_legacy\_target\_group\_names) | Names of legacy target groups which should be included | `list(string)` | `[]` | no |
228229
| <a name="input_name"></a> [name](#input\_name) | Name for this load balancer | `string` | n/a | yes |

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/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ No modules.
3737
| <a name="input_description"></a> [description](#input\_description) | Human description for this load balancer | `string` | n/a | yes |
3838
| <a name="input_enable_access_logs"></a> [enable\_access\_logs](#input\_enable\_access\_logs) | Enable or disable ALB access logs. If set to true, logs will be stored in an S3 bucket. | `bool` | `false` | no |
3939
| <a name="input_enable_connection_logs"></a> [enable\_connection\_logs](#input\_enable\_connection\_logs) | Enable or disable ALB connection logs. If set to true, logs will be stored in an S3 bucket. | `bool` | `false` | no |
40+
| <a name="input_internal_alb"></a> [internal\_alb](#input\_internal\_alb) | If true, the LB will be internal. Defaults to false | `bool` | `false` | no |
4041
| <a name="input_name"></a> [name](#input\_name) | Name for this load balancer | `string` | n/a | yes |
4142
| <a name="input_s3_logs_bucket_name"></a> [s3\_logs\_bucket\_name](#input\_s3\_logs\_bucket\_name) | Optional S3 bucket name for storing ALB access logs. If not provided, a new bucket will be created. | `string` | `""` | no |
4243
| <a name="input_security_group_name"></a> [security\_group\_name](#input\_security\_group\_name) | Name for the load balancer security group; defaults to name | `string` | `null` | no |

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)