Skip to content

Commit d2dc967

Browse files
committed
setup tefca jdbc database connection strings and update db url name
1 parent b341656 commit d2dc967

File tree

7 files changed

+61
-8
lines changed

7 files changed

+61
-8
lines changed

terraform/aws/implementation/main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ module "eks" {
4343
ecr_viewer_s3_role_arn = module.s3.ecr_viewer_s3_role_arn
4444
tefca_viewer_db_role_arn = module.rds.tefca_viewer_db_role_arn
4545
tefca_db_connection_string = module.rds.tefca_db_connection_string
46+
tefca_jdbc_db_url = module.rds.tefca_jdbc_db_url
47+
tefca_jdbc_db_password = module.rds.tefca_jdbc_db_password
48+
tefca_jdbc_db_user = module.rds.tefca_jdbc_db_user
4649
domain_name = local.domain_name
4750
ecr_bucket_name = module.s3.ecr_bucket_name
4851
enable_cognito = var.enable_cognito

terraform/aws/implementation/modules/eks/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
| <a name="input_smarty_auth_id"></a> [smarty\_auth\_id](#input\_smarty\_auth\_id) | value of the SmartyStreets Auth ID | `any` | n/a | yes |
8080
| <a name="input_smarty_auth_token"></a> [smarty\_auth\_token](#input\_smarty\_auth\_token) | value of the SmartyStreets Auth Token | `any` | n/a | yes |
8181
| <a name="input_tefca_db_connection_string"></a> [tefca\_db\_connection\_string](#input\_tefca\_db\_connection\_string) | Connection string to the tefca database | `any` | n/a | yes |
82+
| <a name="input_tefca_jdbc_db_password"></a> [tefca\_jdbc\_db\_password](#input\_tefca\_jdbc\_db\_password) | JDBC password for flyway to the tefca database | `any` | n/a | yes |
83+
| <a name="input_tefca_jdbc_db_url"></a> [tefca\_jdbc\_db\_url](#input\_tefca\_jdbc\_db\_url) | JDBC connection string for flyway to the tefca database | `any` | n/a | yes |
84+
| <a name="input_tefca_jdbc_db_user"></a> [tefca\_jdbc\_db\_user](#input\_tefca\_jdbc\_db\_user) | JDBC username for flyway to the tefca database | `any` | n/a | yes |
8285
| <a name="input_tefca_viewer_db_role_arn"></a> [tefca\_viewer\_db\_role\_arn](#input\_tefca\_viewer\_db\_role\_arn) | The db Role ARN for the Tefca Viewer Service | `any` | n/a | yes |
8386
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | ID of the VPC | `string` | n/a | yes |
8487

terraform/aws/implementation/modules/eks/main.tf

+22-5
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,31 @@ data "external" "latest_phdi_release" {
298298
resource "helm_release" "building_blocks" {
299299
depends_on = [terraform_data.wait_for_load_balancer_controller]
300300
for_each = var.services_to_chart
301-
repository = "https://github.com/CDCgov/phdi-charts/tree/alis/upgrades/2565/85"
301+
repository = "https://cdcgov.github.io/phdi-charts/"
302302
name = "phdi-playground-${terraform.workspace}-${each.key}"
303303
chart = each.value
304304
version = data.external.chart_versions.result[each.value]
305305
force_update = true
306306
recreate_pods = true
307307
cleanup_on_fail = true
308308

309-
set {
310-
name = "databaseUrl"
309+
set_sensitive {
310+
name = "jdbcDatabaseUrl"
311+
value = var.tefca_jdbc_db_url
312+
}
313+
314+
set_sensitive {
315+
name = "jdbcDatabasePassword"
316+
value = var.tefca_jdbc_db_password
317+
}
318+
319+
set_sensitive {
320+
name = "jdbcDatabaseUser"
321+
value = var.tefca_jdbc_db_user
322+
}
323+
324+
set_sensitive {
325+
name = "databaseConnectionString"
311326
value = var.tefca_db_connection_string
312327
}
313328

@@ -316,12 +331,12 @@ resource "helm_release" "building_blocks" {
316331
value = data.external.latest_phdi_release.result.tagName
317332
}
318333

319-
set {
334+
set_sensitive {
320335
name = "smartyAuthId"
321336
value = var.smarty_auth_id
322337
}
323338

324-
set {
339+
set_sensitive {
325340
name = "smartyToken"
326341
value = var.smarty_auth_token
327342
}
@@ -337,6 +352,8 @@ resource "helm_release" "building_blocks" {
337352
}
338353

339354
# Values needed for orchestration service
355+
# "phdi-playground-${terraform.workspace}-${each.key}-${each.key}-service"
356+
# phdi-playground-dev-ecr-viewer-ecr-viewer-service
340357
set {
341358
name = "fhirConverterUrl"
342359
value = "https://${var.domain_name}/fhir-converter"

terraform/aws/implementation/modules/eks/variables.tf

+12
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,16 @@ variable "cognito_domain" {
8989

9090
variable "tefca_db_connection_string" {
9191
description = "Connection string to the tefca database"
92+
}
93+
94+
variable "tefca_jdbc_db_url" {
95+
description = "JDBC connection string for flyway to the tefca database"
96+
}
97+
98+
variable "tefca_jdbc_db_password" {
99+
description = "JDBC password for flyway to the tefca database"
100+
}
101+
102+
variable "tefca_jdbc_db_user" {
103+
description = "JDBC username for flyway to the tefca database"
92104
}

terraform/aws/implementation/modules/rds/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@ No modules.
4848
| Name | Description |
4949
|------|-------------|
5050
| <a name="output_tefca_db_connection_string"></a> [tefca\_db\_connection\_string](#output\_tefca\_db\_connection\_string) | n/a |
51+
| <a name="output_tefca_jdbc_db_password"></a> [tefca\_jdbc\_db\_password](#output\_tefca\_jdbc\_db\_password) | n/a |
52+
| <a name="output_tefca_jdbc_db_url"></a> [tefca\_jdbc\_db\_url](#output\_tefca\_jdbc\_db\_url) | n/a |
53+
| <a name="output_tefca_jdbc_db_user"></a> [tefca\_jdbc\_db\_user](#output\_tefca\_jdbc\_db\_user) | n/a |
5154
| <a name="output_tefca_viewer_db_role_arn"></a> [tefca\_viewer\_db\_role\_arn](#output\_tefca\_viewer\_db\_role\_arn) | n/a |
5255
<!-- END_TF_DOCS -->

terraform/aws/implementation/modules/rds/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ resource "aws_security_group" "ds_sg" {
4040
from_port = 5432
4141
to_port = 5432
4242
protocol = "tcp"
43-
cidr_blocks = ["10.0.0.0/16"]
43+
cidr_blocks = ["176.24.0.0/16"]
4444
}
4545

4646
# Allow all outbound traffic
@@ -69,5 +69,5 @@ resource "random_string" "setup_rds_password" {
6969
length = 13 #update as needed
7070

7171
# Character set that excludes problematic characters like quotes, backslashes, etc.
72-
override_special = "_!@#-$%^&*()[]{}"
72+
override_special = "()[]{}"
7373
}

terraform/aws/implementation/modules/rds/output.tf

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ output "tefca_viewer_db_role_arn" {
33
}
44

55
output "tefca_db_connection_string" {
6-
value = "postgresql://${aws_db_instance.tefca-viewer-db.username}:${aws_db_instance.tefca-viewer-db.password}@${aws_db_instance.tefca-viewer-db.endpoint}:5432/${aws_db_instance.tefca-viewer-db.db_name}"
6+
value = "postgresql://${aws_db_instance.tefca-viewer-db.username}:${aws_db_instance.tefca-viewer-db.password}@${aws_db_instance.tefca-viewer-db.endpoint}/${aws_db_instance.tefca-viewer-db.db_name}"
77
sensitive = true
88
}
9+
10+
output "tefca_jdbc_db_url" {
11+
value = "jdbc:postgresql://${aws_db_instance.tefca-viewer-db.endpoint}/${aws_db_instance.tefca-viewer-db.db_name}"
12+
sensitive = true
13+
}
14+
15+
output "tefca_jdbc_db_user" {
16+
value = aws_db_instance.tefca-viewer-db.username
17+
sensitive = true
18+
}
19+
20+
output "tefca_jdbc_db_password" {
21+
value = aws_db_instance.tefca-viewer-db.password
22+
sensitive = true
23+
}

0 commit comments

Comments
 (0)