diff --git a/services/terraform/remote/service_blob.tf b/services/terraform/remote/service_blob.tf --- a/services/terraform/remote/service_blob.tf +++ b/services/terraform/remote/service_blob.tf @@ -5,6 +5,7 @@ blob_service_container_http_port = 51001 blob_service_container_grpc_port = 50051 blob_service_grpc_public_port = 50053 + blob_service_domain_name = "blob.${local.root_domain}" } resource "aws_ecs_task_definition" "blob_service" { @@ -234,7 +235,7 @@ # SSL Certificate data "aws_acm_certificate" "blob_service" { - domain = "blob.commtechnologies.org" + domain = local.blob_service_domain_name statuses = ["ISSUED"] } diff --git a/services/terraform/remote/service_electron_update.tf b/services/terraform/remote/service_electron_update.tf --- a/services/terraform/remote/service_electron_update.tf +++ b/services/terraform/remote/service_electron_update.tf @@ -2,6 +2,8 @@ electron_update_container_name = "electron-update-server" electron_update_container_port = 80 electron_update_server_image = "commapp/electron-update-server:1.0" + + electron_update_domain_name = "electron-update.${local.root_domain}" } # Task definition - defines container resources, ports, @@ -183,7 +185,7 @@ # SSL Certificate data "aws_acm_certificate" "electron_update" { - domain = "electron-update.commtechnologies.org" + domain = local.electron_update_domain_name statuses = ["ISSUED"] } diff --git a/services/terraform/remote/service_feature_flags.tf b/services/terraform/remote/service_feature_flags.tf --- a/services/terraform/remote/service_feature_flags.tf +++ b/services/terraform/remote/service_feature_flags.tf @@ -3,6 +3,7 @@ feature_flags_container_name = "feature-flags-server" feature_flags_container_port = 50051 feature_flags_server_image = "commapp/feature-flags:${local.feature_flags_image_tag}" + feature_flags_domain_name = "feature-flags.${local.root_domain}" } # Task definition - defines container resources, ports, @@ -191,7 +192,7 @@ # SSL Certificate data "aws_acm_certificate" "feature_flags" { - domain = "feature-flags.commtechnologies.org" + domain = local.feature_flags_domain_name statuses = ["ISSUED"] } diff --git a/services/terraform/remote/service_identity.tf b/services/terraform/remote/service_identity.tf --- a/services/terraform/remote/service_identity.tf +++ b/services/terraform/remote/service_identity.tf @@ -7,6 +7,7 @@ identity_service_container_grpc_port = 50054 # Port that is exposed to the public SSL endpoint (appended to domain name) identity_service_grpc_public_port = 50054 + identity_service_domain_name = "identity.${local.root_domain}" opaque_server_setup_secret_name = "identity/ServerSetup" } @@ -193,7 +194,7 @@ # SSL Certificate data "aws_acm_certificate" "identity_service" { - domain = "identity.commtechnologies.org" + domain = local.identity_service_domain_name statuses = ["ISSUED"] } diff --git a/services/terraform/remote/variables.tf b/services/terraform/remote/variables.tf new file mode 100644 --- /dev/null +++ b/services/terraform/remote/variables.tf @@ -0,0 +1,3 @@ +locals { + root_domain = local.environment == "production" ? "commtechnologies.org" : "staging.commtechnologies.org" +}