Skip to content

Commit

Permalink
Allow custom SSL policy for the Load Balancer Controller
Browse files Browse the repository at this point in the history
Some servers may have more strict requirements for their TLS listeners.
The `ELBSecurityPolicy-2016-08` policy is the default security policy
for TLS listeners created using the AWS CLI.

This change allows a customization on the Load Balancer Controller to
specify a different security policy.

[Reference](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html).
  • Loading branch information
clarissalimab committed Jul 18, 2024
1 parent 8e29883 commit d2ef866
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
17 changes: 9 additions & 8 deletions aws/platform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ module "common_platform" {
module "aws_load_balancer_controller" {
source = "./modules/load-balancer-controller"

aws_namespace = [module.cluster_name.full]
aws_tags = var.aws_tags
chart_values = var.aws_load_balancer_controller_values
chart_version = var.aws_load_balancer_controller_version
cluster_full_name = module.cluster_name.full
k8s_namespace = var.k8s_namespace
oidc_issuer = data.aws_ssm_parameter.oidc_issuer.value
vpc_cidr_block = module.network.vpc.cidr_block
aws_namespace = [module.cluster_name.full]
aws_tags = var.aws_tags
chart_values = var.aws_load_balancer_controller_values
chart_version = var.aws_load_balancer_controller_version
cluster_full_name = module.cluster_name.full
default_ssl_policy = var.default_ssl_policy
k8s_namespace = var.k8s_namespace
oidc_issuer = data.aws_ssm_parameter.oidc_issuer.value
vpc_cidr_block = module.network.vpc.cidr_block

depends_on = [module.common_platform]
}
Expand Down
2 changes: 2 additions & 0 deletions aws/platform/modules/load-balancer-controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ locals {
"eks.amazonaws.com/role-arn" = module.service_account_role.arn
}
}

defaultSSLPolicy = coalesce(var.default_ssl_policy, "ELBSecurityPolicy-TLS13-1-2-2021-06")
})
]
}
6 changes: 6 additions & 0 deletions aws/platform/modules/load-balancer-controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ variable "vpc_cidr_block" {
type = string
description = "CIDR block for the AWS VPC in which the load balancer runs"
}

variable "default_ssl_policy" {
type = string
description = "The default SSL policy to use for the load balancer"
default = null
}
6 changes: 6 additions & 0 deletions aws/platform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ variable "custom_roles" {
default = {}
}

variable "default_ssl_policy" {
type = string
description = "The default SSL policy to use for the load balancer"
default = null
}

variable "domain_names" {
type = list(string)
default = []
Expand Down

0 comments on commit d2ef866

Please sign in to comment.