Skip to content

Commit 7e75eec

Browse files
authored
feat: Configurable default action https listener (#391)
feat: configurable default action https listener Make the ALB https listener default action configurable
1 parent 3433ecf commit 7e75eec

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ No resources.
236236
| Name | Description | Type | Default | Required |
237237
|------|-------------|------|---------|:--------:|
238238
| <a name="input_alb"></a> [alb](#input\_alb) | Map of values passed to ALB module definition. See the [ALB module](https://github.com/terraform-aws-modules/terraform-aws-alb) for full list of arguments supported | `any` | `{}` | no |
239+
| <a name="input_alb_https_default_action"></a> [alb\_https\_default\_action](#input\_alb\_https\_default\_action) | Default action for the ALB https listener | `any` | <pre>{<br> "forward": {<br> "target_group_key": "atlantis"<br> }<br>}</pre> | no |
239240
| <a name="input_alb_security_group_id"></a> [alb\_security\_group\_id](#input\_alb\_security\_group\_id) | ID of an existing security group that will be used by ALB. Required if `create_alb` is `false` | `string` | `""` | no |
240241
| <a name="input_alb_subnets"></a> [alb\_subnets](#input\_alb\_subnets) | List of subnets to place ALB in. Required if `create_alb` is `true` | `list(string)` | `[]` | no |
241242
| <a name="input_alb_target_group_arn"></a> [alb\_target\_group\_arn](#input\_alb\_target\_group\_arn) | ARN of an existing ALB target group that will be used to route traffic to the Atlantis service. Required if `create_alb` is `false` | `string` | `""` | no |

main.tf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,8 @@ module "alb" {
7878
protocol = "HTTPS"
7979
ssl_policy = try(var.alb.https_listener_ssl_policy, "ELBSecurityPolicy-TLS13-1-2-Res-2021-06")
8080
certificate_arn = var.create_certificate ? module.acm.acm_certificate_arn : var.certificate_arn
81-
82-
forward = {
83-
target_group_key = "atlantis"
84-
}
8581
},
82+
var.alb_https_default_action,
8683
lookup(var.alb, "https_listener", {})
8784
)
8885
},

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ variable "alb" {
6868
default = {}
6969
}
7070

71+
variable "alb_https_default_action" {
72+
description = "Default action for the ALB https listener"
73+
type = any
74+
default = {
75+
forward = {
76+
target_group_key = "atlantis"
77+
}
78+
}
79+
}
80+
7181
variable "alb_subnets" {
7282
description = "List of subnets to place ALB in. Required if `create_alb` is `true`"
7383
type = list(string)

0 commit comments

Comments
 (0)