Skip to content

Commit ca385dc

Browse files
committed
refactor: remove unnecessary configuration for alb and capacity-provider
1 parent 8b92395 commit ca385dc

File tree

6 files changed

+17
-62
lines changed

6 files changed

+17
-62
lines changed

modules/alb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ No modules.
3131
|------|-------------|------|---------|:--------:|
3232
| <a name="input_enable_deletion_protection"></a> [enable\_deletion\_protection](#input\_enable\_deletion\_protection) | (Optional) If true, deletion of the load balancer will be disabled via the AWS API. | `bool` | `false` | no |
3333
| <a name="input_internal"></a> [internal](#input\_internal) | (Optional) If true, the LB will be internal. | `bool` | `false` | no |
34-
| <a name="input_listeners"></a> [listeners](#input\_listeners) | Listeners to forward ALB ingress to desired Target Groups. | <pre>map(object({<br> default_action = list(object({<br> type = string<br> target_group = string<br> authenticate_cognito = optional(any, null)<br> authenticate_oidc = optional(any, null)<br> fixed_response = optional(any, null)<br> forward = optional(any, null)<br> order = optional(number)<br> redirect = optional(any, null)<br> }))<br> alpn_policy = optional(string)<br> certificate_arn = optional(string)<br> mutual_authentication = optional(any, null)<br> port = optional(number)<br> protocol = optional(string)<br> ssl_policy = optional(string)<br> tags = optional(map(string), {})<br> }))</pre> | n/a | yes |
34+
| <a name="input_listeners"></a> [listeners](#input\_listeners) | Listeners to forward ALB ingress to desired Target Groups. | <pre>map(object({<br> default_action = list(object({<br> type = string<br> target_group = string<br> fixed_response = optional(any, null)<br> forward = optional(any, null)<br> order = optional(number)<br> redirect = optional(any, null)<br> }))<br> alpn_policy = optional(string)<br> certificate_arn = optional(string)<br> port = optional(number)<br> protocol = optional(string)<br> ssl_policy = optional(string)<br> tags = optional(map(string), {})<br> }))</pre> | n/a | yes |
3535
| <a name="input_name"></a> [name](#input\_name) | (Optional) Name of the LB. | `string` | `""` | no |
3636
| <a name="input_preserve_host_header"></a> [preserve\_host\_header](#input\_preserve\_host\_header) | (Optional) Whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. | `bool` | `false` | no |
3737
| <a name="input_security_groups_ids"></a> [security\_groups\_ids](#input\_security\_groups\_ids) | (Optional) List of security group IDs to assign to the LB. | `list(string)` | `[]` | no |

modules/alb/main.tf

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ resource "aws_lb_listener" "this" {
6464
protocol = each.value.protocol
6565
ssl_policy = each.value.ssl_policy
6666

67-
dynamic "mutual_authentication" {
68-
for_each = try(each.value.mutual_authentication, null) != null ? [1] : []
69-
70-
content {
71-
mode = each.value.mutual_authentication.mode
72-
trust_store_arn = each.value.mutual_authentication.trust_store_arn
73-
ignore_client_certificate_expiry = try(each.value.mutual_authentication.ignore_client_certificate_expiry, null)
74-
}
75-
}
76-
7767
dynamic "default_action" {
7868
for_each = each.value.default_action
7969
iterator = default_action
@@ -83,39 +73,6 @@ resource "aws_lb_listener" "this" {
8373
target_group_arn = aws_lb_target_group.this[default_action.value.target_group].arn
8474
order = default_action.value.order
8575

86-
dynamic "authenticate_cognito" {
87-
for_each = try(default_action.value.authenticate_cognito, null) != null ? [1] : []
88-
89-
content {
90-
user_pool_arn = default_action.value.authenticate_cognito.user_pool_arn
91-
user_pool_client_id = default_action.value.authenticate_cognito.user_pool_client_id
92-
user_pool_domain = default_action.value.authenticate_cognito.user_pool_domain
93-
authentication_request_extra_params = try(default_action.value.authenticate_cognito.authentication_request_extra_params, null)
94-
on_unauthenticated_request = try(default_action.value.authenticate_cognito.on_unauthenticated_request, null)
95-
scope = try(default_action.value.authenticate_cognito.scope, null)
96-
session_cookie_name = try(default_action.value.authenticate_cognito.session_cookie_name, null)
97-
session_timeout = try(default_action.value.authenticate_cognito.session_timeout, null)
98-
}
99-
}
100-
101-
dynamic "authenticate_oidc" {
102-
for_each = try(default_action.value.authenticate_oidc, null) != null ? [1] : []
103-
104-
content {
105-
authorization_endpoint = default_action.value.authenticate_oidc.authorization_endpoint
106-
client_id = default_action.value.authenticate_oidc.client_id
107-
client_secret = default_action.value.authenticate_oidc.client_secret
108-
issuer = default_action.value.authenticate_oidc.issuer
109-
token_endpoint = default_action.value.authenticate_oidc.token_endpoint
110-
user_info_endpoint = default_action.value.authenticate_oidc.user_info_endpoint
111-
authentication_request_extra_params = try(default_action.value.authenticate_oidc.authentication_request_extra_params, null)
112-
on_unauthenticated_request = try(default_action.value.authenticate_oidc.on_unauthenticated_request, null)
113-
scope = try(default_action.value.authenticate_oidc.scope, null)
114-
session_cookie_name = try(default_action.value.authenticate_oidc.session_cookie_name, null)
115-
session_timeout = try(default_action.value.authenticate_oidc.session_timeout, null)
116-
}
117-
}
118-
11976
dynamic "fixed_response" {
12077
for_each = try(default_action.value.fixed_response, null) != null ? [1] : []
12178

modules/alb/variables.tf

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,18 @@ variable "listeners" {
6969
description = "Listeners to forward ALB ingress to desired Target Groups."
7070
type = map(object({
7171
default_action = list(object({
72-
type = string
73-
target_group = string
74-
authenticate_cognito = optional(any, null)
75-
authenticate_oidc = optional(any, null)
76-
fixed_response = optional(any, null)
77-
forward = optional(any, null)
78-
order = optional(number)
79-
redirect = optional(any, null)
72+
type = string
73+
target_group = string
74+
fixed_response = optional(any, null)
75+
forward = optional(any, null)
76+
order = optional(number)
77+
redirect = optional(any, null)
8078
}))
81-
alpn_policy = optional(string)
82-
certificate_arn = optional(string)
83-
mutual_authentication = optional(any, null)
84-
port = optional(number)
85-
protocol = optional(string)
86-
ssl_policy = optional(string)
87-
tags = optional(map(string), {})
79+
alpn_policy = optional(string)
80+
certificate_arn = optional(string)
81+
port = optional(number)
82+
protocol = optional(string)
83+
ssl_policy = optional(string)
84+
tags = optional(map(string), {})
8885
}))
8986
}

modules/capacity-provider/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ No modules.
2828

2929
| Name | Description | Type | Default | Required |
3030
|------|-------------|------|---------|:--------:|
31-
| <a name="input_capacity_providers"></a> [capacity\_providers](#input\_capacity\_providers) | Capacity Providers to associate with the ECS Cluster. | <pre>map(object({<br> name = string<br> auto_scaling_group_arn = optional(string)<br> managed_scaling = optional(<br> object({<br> instance_warmup_period = optional(number)<br> status = optional(string)<br> target_capacity = optional(number)<br> minimum_scaling_step_size = optional(number)<br> maximum_scaling_step_size = optional(number)<br> })<br> )<br> tags = optional(map(string), {})<br> }))</pre> | `{}` | no |
31+
| <a name="input_capacity_providers"></a> [capacity\_providers](#input\_capacity\_providers) | Capacity Providers to associate with the ECS Cluster. | <pre>map(object({<br> name = string<br> auto_scaling_group_arn = optional(string)<br> managed_scaling = optional(<br> object({<br> instance_warmup_period = optional(number)<br> status = optional(string)<br> target_capacity = optional(number)<br> minimum_scaling_step_size = optional(number)<br> maximum_scaling_step_size = optional(number)<br> })<br> )<br> managed_termination_protection = optional(string, "ENABLED")<br> tags = optional(map(string), {})<br> }))</pre> | `{}` | no |
3232
| <a name="input_default_auto_scaling_group_arn"></a> [default\_auto\_scaling\_group\_arn](#input\_default\_auto\_scaling\_group\_arn) | ARN for this Auto Scaling Group. | `string` | n/a | yes |
3333
| <a name="input_default_capacity_provider_strategies"></a> [default\_capacity\_provider\_strategies](#input\_default\_capacity\_provider\_strategies) | (Optional) Set of capacity provider strategies to use by default for the cluster. | <pre>list(object({<br> capacity_provider = string<br> weight = optional(number, 0)<br> base = optional(number, 0)<br> }))</pre> | `[]` | no |
3434
| <a name="input_ecs_cluster_name"></a> [ecs\_cluster\_name](#input\_ecs\_cluster\_name) | (Required) Name of the cluster. | `string` | n/a | yes |

modules/capacity-provider/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ resource "aws_ecs_capacity_provider" "this" {
2222
}
2323
}
2424

25-
managed_termination_protection = "ENABLED"
25+
managed_termination_protection = each.value.managed_termination_protection
2626
}
2727

2828
tags = each.value.tags

modules/capacity-provider/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ variable "capacity_providers" {
1616
maximum_scaling_step_size = optional(number)
1717
})
1818
)
19-
tags = optional(map(string), {})
19+
managed_termination_protection = optional(string, "ENABLED")
20+
tags = optional(map(string), {})
2021
}))
2122
default = {}
2223
}

0 commit comments

Comments
 (0)