Skip to content

Commit

Permalink
Merge pull request #3600 from ministryofjustice/NIT-859-ldap-data-ref…
Browse files Browse the repository at this point in the history
…resh-po-c-datasync-method

Nit 859 ldap data refresh po c datasync method - unique names
  • Loading branch information
shazChaudhry authored Oct 6, 2023
2 parents 0790718 + bad52de commit 69ff7a6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion terraform/environments/delius-core/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locals {
db_name = "MODNDA"

frontend_url = "${local.application_name}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"
frontend_service_name = "testing-frontend"
frontend_service_name = "frontend"
frontend_fully_qualified_name = "${local.application_name}-${local.frontend_service_name}"
frontend_image_tag = "5.7.6"
frontend_container_port = 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ locals {
weblogic_config_dev = {
name = try(local.weblogic_config_lower_environments.name, "weblogic")
frontend_service_name = try(local.weblogic_config_lower_environments.frontend_service_name, "weblogic")
frontend_fully_qualified_name = try(local.weblogic_config_lower_environments.frontend_fully_qualified_name, "${local.application_name}-${local.frontend_service_name}")
frontend_fully_qualified_name = "${local.application_name}-dev-${local.frontend_service_name}"
frontend_image_tag = try(local.weblogic_config_lower_environments.frontend_image_tag, "5.7.6")
frontend_container_port = try(local.weblogic_config_lower_environments.frontend_container_port, 8080)
frontend_url_suffix = try(local.weblogic_config_lower_environments.frontend_url_suffix, "${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk")
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/delius-core/locals_development_test.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ locals {
weblogic_config_test = {
name = try(local.weblogic_config_lower_environments.name, "weblogic")
frontend_service_name = try(local.weblogic_config_lower_environments.frontend_service_name, "weblogic")
frontend_fully_qualified_name = try(local.weblogic_config_lower_environments.frontend_fully_qualified_name, "${local.application_name}-${local.frontend_service_name}")
frontend_fully_qualified_name = "${local.application_name}-test-${local.frontend_service_name}"
frontend_image_tag = try(local.weblogic_config_lower_environments.frontend_image_tag, "5.7.6")
frontend_container_port = try(local.weblogic_config_lower_environments.frontend_container_port, 8080)
frontend_url_suffix = try(local.weblogic_config_lower_environments.frontend_url_suffix, "${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk")
Expand All @@ -120,7 +120,7 @@ locals {
delius_db_container_config_test = {
image_tag = "5.7.4"
image_name = "delius-core-testing-db"
fully_qualified_name = "test-db"
fully_qualified_name = "testing-db"
port = 1521
name = "MODNDA"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module "testing_db_service" {
environment = var.env_name
namespace = var.app_name

security_group_ids = [aws_security_group.weblogic.id]
security_group_ids = [aws_security_group.delius_db_security_group.id]

subnet_ids = var.account_config.private_subnet_ids

Expand All @@ -74,11 +74,11 @@ resource "aws_route53_record" "delius-core-db" {
name = "${var.app_name}-${var.env_name}-${var.delius_db_container_config.fully_qualified_name}.${var.account_config.route53_inner_zone_info.name}"
type = "A"
ttl = 300
records = ["10.26.25.202"]
records = ["10.26.24.243"]
}

resource "aws_security_group" "delius_db_security_group" {
name = "Delius Core DB"
name = format("%s - Delius Core DB", var.env_name)
description = "Rules for the delius testing db ecs service"
vpc_id = var.account_config.shared_vpc_id
tags = local.tags
Expand Down Expand Up @@ -106,11 +106,21 @@ resource "aws_vpc_security_group_egress_rule" "delius_db_security_group_egress_i
security_group_id = aws_security_group.delius_db_security_group.id
description = "outbound from the testing db ecs service"
ip_protocol = "tcp"
to_port = 443
from_port = 443
to_port = 1521
from_port = 1521
cidr_ipv4 = "0.0.0.0/0"
}

resource "aws_vpc_security_group_ingress_rule" "delius_db_security_group_ingress_weblogic" {
security_group_id = aws_security_group.delius_db_security_group.id
description = "weblogic to testing db"
from_port = var.delius_db_container_config.port
to_port = var.delius_db_container_config.port
ip_protocol = "tcp"
referenced_security_group_id = aws_security_group.weblogic.id
}


resource "aws_cloudwatch_log_group" "delius_core_testing_db_log_group" {
name = format("%s-%s", var.env_name, var.delius_db_container_config.fully_qualified_name)
retention_in_days = 7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
frontend_url = "${var.app_name}.${var.env_name}.${var.weblogic_config.frontend_url_suffix}"
}
resource "aws_security_group" "delius_frontend_alb_security_group" {
name = "Delius Core Frontend Load Balancer"
name = format("%s - Delius Core Frontend Load Balancer", var.env_name)
description = "controls access to and from delius front-end load balancer"
vpc_id = var.account_config.shared_vpc_id
tags = local.tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
##

resource "aws_ssm_parameter" "delius_core_frontend_env_var_jdbc_url" {
name = format("/%s/%s/JCBC_URL", var.account_info.application_name, var.env_name)
name = format("/%s-%s/JDBC_URL", var.account_info.application_name, var.env_name)
type = "SecureString"
value = format("jdbc:oracle:thin:@//INITIAL_HOSTNAME_OVERRIDEN:INITIAL_PORT_OVERRIDDEN/%s", var.weblogic_config.db_name)
tags = local.tags
Expand All @@ -16,7 +16,7 @@ resource "aws_ssm_parameter" "delius_core_frontend_env_var_jdbc_url" {
}

resource "aws_ssm_parameter" "delius_core_frontend_env_var_jdbc_password" {
name = format("/%s/%s/JCBC_PASSWORD", var.account_info.application_name, var.env_name)
name = format("/%s-%s/JDBC_PASSWORD", var.account_info.application_name, var.env_name)
type = "SecureString"
value = "INITIAL_VALUE_OVERRIDDEN"
tags = local.tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ module "weblogic_container" {
{
name = "LDAP_PORT"
value = local.ldap_port
},
{
name = "LDAP_HOST"
value = aws_lb.ldap.dns_name
}
]
secrets = [
Expand Down Expand Up @@ -109,7 +113,7 @@ module "weblogic_service" {


resource "aws_security_group" "delius_core_frontend_security_group" {
name = "Delius Core Frontend Weblogic"
name = format("%s - Delius Core Frontend Weblogic", var.env_name)
description = "Rules for the delius testing frontend ecs service"
vpc_id = var.account_config.shared_vpc_id
tags = local.tags
Expand Down Expand Up @@ -209,7 +213,7 @@ resource "aws_security_group_rule" "weblogic_alb" {
}

resource "aws_cloudwatch_log_group" "delius_core_frontend_log_group" {
name = format("%s-%s", var.env_name, var.weblogic_config.frontend_fully_qualified_name)
name = var.weblogic_config.frontend_fully_qualified_name
retention_in_days = 7
tags = local.tags
}

0 comments on commit 69ff7a6

Please sign in to comment.