Skip to content

Commit 7fced43

Browse files
author
rohit-ng
committed
update: module to take domain as input and refactor
1 parent f3c1cbd commit 7fced43

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

locals.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ locals {
2424
major_engine_version = 16
2525
port = 5432
2626
sg_name = "kong-postgres"
27+
sg_description = "Allow all traffic within vpc"
2728
postgres_username = data.aws_ssm_parameter.rds["POSTGRES_USERNAME"].value
2829
postgres_password = data.aws_ssm_parameter.rds["POSTGRES_PASSWORD"].value
2930
postgres_db_name = data.aws_ssm_parameter.rds["POSTGRES_DB_NAME"].value

main.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ module "postgres_security_group" {
2323
version = "~> 5.1.2"
2424

2525
name = local.rds.sg_name
26-
description = "Allow all traffic within vpc"
26+
description = local.rds.sg_description
2727
vpc_id = var.vpc_id
2828

2929
ingress_with_cidr_blocks = [
3030
{
3131
from_port = 0
32-
to_port = 5432
32+
to_port = local.rds.port
3333
protocol = "tcp"
3434
cidr_blocks = data.aws_vpc.vpc.cidr_block
3535
},
@@ -345,6 +345,7 @@ module "internal_alb_kong" {
345345
protocol = "HTTP"
346346
target_type = "ip"
347347
vpc_id = var.vpc_id
348+
348349
health_check = {
349350
enabled = true
350351
path = "/status"
@@ -386,8 +387,7 @@ module "internal_alb_kong" {
386387
module "kong_public_dns_record" {
387388
source = "./modules/route-53-record"
388389

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

402-
base_domain = var.base_domain
403-
endpoints = var.kong_admin_sub_domain_names
402+
domain = "admin.gaussb.io"
404403
alb_dns_name = module.internal_alb_kong.dns_name
405404
alb_zone_id = module.ecs_kong.alb_zone_id
406405
}

0 commit comments

Comments
 (0)