Skip to content

Commit e5b98cd

Browse files
author
rohit-ng
committed
fix: replace static values with variables
1 parent 7fced43 commit e5b98cd

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ This command will display the values of the stored parameters, ensuring they hav
113113
| <a name="input_asg_name"></a> [asg\_name](#input\_asg\_name) | Name of the auto scaling group | `string` | `"default"` | no |
114114
| <a name="input_backup_retention_period"></a> [backup\_retention\_period](#input\_backup\_retention\_period) | The number of days to retain backups | `number` | `1` | no |
115115
| <a name="input_backup_window"></a> [backup\_window](#input\_backup\_window) | The daily time range (in UTC) during which automated backups are created if they are enabled | `string` | `null` | no |
116-
| <a name="input_base_domain"></a> [base\_domain](#input\_base\_domain) | Base domain | `string` | n/a | yes |
117116
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the cluster | `string` | `"default"` | no |
118117
| <a name="input_container_image"></a> [container\_image](#input\_container\_image) | Container image for kong | `string` | `"kong:3.7.1-ubuntu"` | no |
119118
| <a name="input_cpu_for_kong_task"></a> [cpu\_for\_kong\_task](#input\_cpu\_for\_kong\_task) | CPU required for kong task definiton | `number` | `256` | no |
@@ -123,8 +122,8 @@ This command will display the values of the stored parameters, ensuring they hav
123122
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | Whether to enable deletion protection | `bool` | `false` | no |
124123
| <a name="input_desired_count_for_kong_service"></a> [desired\_count\_for\_kong\_service](#input\_desired\_count\_for\_kong\_service) | Desired count for kong service | `number` | `1` | no |
125124
| <a name="input_force_new_deployment"></a> [force\_new\_deployment](#input\_force\_new\_deployment) | Whether to force new deployment | `bool` | `true` | no |
126-
| <a name="input_kong_admin_sub_domain_names"></a> [kong\_admin\_sub\_domain\_names](#input\_kong\_admin\_sub\_domain\_names) | List of kong admin sub domain names | `list(any)` | n/a | yes |
127-
| <a name="input_kong_public_sub_domain_names"></a> [kong\_public\_sub\_domain\_names](#input\_kong\_public\_sub\_domain\_names) | List of kong public sub domain names | `list(any)` | n/a | yes |
125+
| <a name="input_kong_admin_domain_name"></a> [kong\_admin\_domain\_name](#input\_kong\_admin\_domain\_name) | Kong public domain name | `string` | n/a | yes |
126+
| <a name="input_kong_public_domain_name"></a> [kong\_public\_domain\_name](#input\_kong\_public\_domain\_name) | Kong public domain name | `string` | n/a | yes |
128127
| <a name="input_log_configuration_for_kong"></a> [log\_configuration\_for\_kong](#input\_log\_configuration\_for\_kong) | Log configuration for kong | `any` | `null` | no |
129128
| <a name="input_maintenance_window"></a> [maintenance\_window](#input\_maintenance\_window) | The window to perform maintenance in.Syntax:ddd:hh24:mi-ddd:hh24:mi | `string` | `null` | no |
130129
| <a name="input_manage_master_user_password"></a> [manage\_master\_user\_password](#input\_manage\_master\_user\_password) | Whether to manage master user password | `bool` | `false` | no |

locals.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ locals {
5050

5151
public_target_group = "kong_public"
5252
internal_target_group = "kong_internal"
53-
public_domains = [for subdomain in var.kong_public_sub_domain_names : "${subdomain}.${var.base_domain}"]
54-
admin_domains = [for subdomain in var.kong_admin_sub_domain_names : "${subdomain}.${var.base_domain}"]
55-
5653

5754
admin_port = 8001
5855
proxy_port = 8000

main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ module "ecs_kong" {
312312
conditions = [
313313
{
314314
field = "host-header"
315-
values = local.kong.public_domains
315+
values = var.kong_public_domain_name
316316
}
317317
]
318318
},
@@ -371,7 +371,7 @@ module "internal_alb_kong" {
371371
conditions = [
372372
{
373373
field = "host-header"
374-
values = local.kong.admin_domains
374+
values = var.kong_admin_domain_name
375375
}
376376
]
377377
},
@@ -387,7 +387,7 @@ module "internal_alb_kong" {
387387
module "kong_public_dns_record" {
388388
source = "./modules/route-53-record"
389389

390-
domain = "kong.gaussb.io"
390+
domain = var.kong_public_domain_name
391391
alb_dns_name = module.ecs_kong.alb_dns_name
392392
alb_zone_id = module.ecs_kong.alb_zone_id
393393
}
@@ -399,7 +399,7 @@ module "kong_public_dns_record" {
399399
module "kong_internal_dns_record" {
400400
source = "./modules/route-53-record"
401401

402-
domain = "admin.gaussb.io"
402+
domain = var.kong_admin_domain_name
403403
alb_dns_name = module.internal_alb_kong.dns_name
404404
alb_zone_id = module.ecs_kong.alb_zone_id
405405
}

variables.tf

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,14 @@ variable "ssl_policy" {
109109
default = "ELBSecurityPolicy-2016-08"
110110
}
111111

112-
variable "kong_public_sub_domain_names" {
113-
description = "List of kong public sub domain names"
114-
type = list(any)
115-
}
116-
117-
variable "kong_admin_sub_domain_names" {
118-
description = "List of kong admin sub domain names"
119-
type = list(any)
112+
variable "kong_public_domain_name" {
113+
description = "Kong public domain name"
114+
type = string
120115
}
121116

122-
variable "base_domain" {
117+
variable "kong_admin_domain_name" {
118+
description = "Kong public domain name"
123119
type = string
124-
description = "Base domain"
125120
}
126121

127122
variable "maximum_scaling_step_size" {

0 commit comments

Comments
 (0)