Skip to content

Commit

Permalink
Ccl 859/central ingress modules (#193)
Browse files Browse the repository at this point in the history
* variablised the aws_lb params

* variablized the aws_lb params
  • Loading branch information
parav24 authored Nov 4, 2024
1 parent 7def538 commit 3fd0789
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 19 deletions.
3 changes: 3 additions & 0 deletions modules/aws/networking/alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ inputs = {
load_balancer_type = "application"
load_balancer_internal = false
enable_deletion_protection = true
enable_cross_zone_load_balancing = true
enable_http2 = false
vpc_id = "vpc-example"
subnets = ["subnet-1", "subnet-2", "subnet-3"] # subnets from vpc
certificate_arn = "arn:aws:acm:eu-west-2:<account-id>:certificate/example_cert"
access_logs_bucket = "example-alb-accesslogs-bucket"
access_logs_enabled = false
tg_port = "443"
tg_protocol = "HTTPS"
Expand Down
14 changes: 7 additions & 7 deletions modules/aws/networking/alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ resource "aws_lb" "lb" {
load_balancer_type = var.load_balancer_type
subnets = var.subnets
security_groups = [aws_security_group.sg.id]
enable_cross_zone_load_balancing = true
enable_deletion_protection = true
enable_http2 = false
enable_cross_zone_load_balancing = var.enable_cross_zone_load_balancing
enable_deletion_protection = var.enable_deletion_protection
enable_http2 = var.enable_http2

# access_logs {
# bucket = var.access_logs_bucket
# enabled = true
# }
access_logs {
bucket = var.access_logs_bucket
enabled = var.access_logs_enabled
}

tags = {
Name = var.name
Expand Down
19 changes: 17 additions & 2 deletions modules/aws/networking/alb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ variable "access_logs_bucket" {
description = "S3 bucket for NLB access logs"
}

variable "enable_deletion_protection" {
variable "access_logs_enabled" {
type = string
description = "enable_deletion_protection true or false"
description = "access_logs_enabled - true or false"
}

variable "load_balancer_type" {
Expand Down Expand Up @@ -70,6 +70,21 @@ variable "nlb_ips" {
# }
}

variable "enable_deletion_protection" {
type = string
description = "enable_deletion_protection - true or false"
}

variable "enable_cross_zone_load_balancing" {
type = string
description = "enable_cross_zone_load_balancing - true or false"
}

variable "enable_http2" {
type = string
description = "enable_http2 - true or false"
}

# SG related

variable "ingress_rules" {
Expand Down
5 changes: 4 additions & 1 deletion modules/aws/networking/nlb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ inputs = {
load_balancer_type = "network"
load_balancer_internal = true
enable_deletion_protection = true
enable_cross_zone_load_balancing = true
enable_http2 = false
vpc_id = "vpc-example"
subnets = ["subnet-1", "subnet-2", "subnet-3"]
certificate_arn = "arn:aws:acm:eu-west-2:<account-id>:certificate/<example-cert-id>
access_logs_bucket = "example-nlb-accesslogs-bucket"
access_logs_enabled = false
tg_port = "80"
tg_protocol = "TCP"
target_type = "instance" # allowed values are: ip or instance or alb or lambda
Expand Down
14 changes: 7 additions & 7 deletions modules/aws/networking/nlb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ resource "aws_lb" "lb" {
load_balancer_type = var.load_balancer_type
subnets = var.subnets
security_groups = [aws_security_group.sg.id]
enable_cross_zone_load_balancing = true
enable_deletion_protection = true
enable_http2 = false
enable_cross_zone_load_balancing = var.enable_cross_zone_load_balancing
enable_deletion_protection = var.enable_deletion_protection
enable_http2 = var.enable_http2

# access_logs {
# bucket = var.access_logs_bucket
# enabled = true
# }
access_logs {
bucket = var.access_logs_bucket
enabled = var.access_logs_enabled
}

tags = {
Name = var.name
Expand Down
19 changes: 17 additions & 2 deletions modules/aws/networking/nlb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ variable "access_logs_bucket" {
description = "S3 bucket for NLB access logs"
}

variable "enable_deletion_protection" {
variable "access_logs_enabled" {
type = string
description = "enable_deletion_protection true or false"
description = "access_logs_enabled - true or false"
}

variable "load_balancer_type" {
Expand Down Expand Up @@ -71,6 +71,21 @@ variable "instance_targets" {
# }
}

variable "enable_deletion_protection" {
type = string
description = "enable_deletion_protection - true or false"
}

variable "enable_cross_zone_load_balancing" {
type = string
description = "enable_cross_zone_load_balancing - true or false"
}

variable "enable_http2" {
type = string
description = "enable_http2 - true or false"
}

# SG related

variable "ingress_rules" {
Expand Down

0 comments on commit 3fd0789

Please sign in to comment.