Skip to content

Commit

Permalink
feat: Configurable default action https listener (#391)
Browse files Browse the repository at this point in the history
feat: configurable default action https listener

Make the ALB https listener default action configurable
  • Loading branch information
aalvarezaph committed Jan 18, 2024
1 parent 3433ecf commit 7e75eec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
Expand Down
5 changes: 1 addition & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ module "alb" {
protocol = "HTTPS"
ssl_policy = try(var.alb.https_listener_ssl_policy, "ELBSecurityPolicy-TLS13-1-2-Res-2021-06")
certificate_arn = var.create_certificate ? module.acm.acm_certificate_arn : var.certificate_arn

forward = {
target_group_key = "atlantis"
}
},
var.alb_https_default_action,
lookup(var.alb, "https_listener", {})
)
},
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ variable "alb" {
default = {}
}

variable "alb_https_default_action" {
description = "Default action for the ALB https listener"
type = any
default = {
forward = {
target_group_key = "atlantis"
}
}
}

variable "alb_subnets" {
description = "List of subnets to place ALB in. Required if `create_alb` is `true`"
type = list(string)
Expand Down

0 comments on commit 7e75eec

Please sign in to comment.