From 313b7c77de032c6a7e6c2a9339fd5e01fb49b0e2 Mon Sep 17 00:00:00 2001 From: Jennifer Tran <12633533+botanical@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:15:11 -0700 Subject: [PATCH] fix: update domain names to support multiple domain names for prod --- routes/infrastructure/construct.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/routes/infrastructure/construct.py b/routes/infrastructure/construct.py index 524924e7..882da433 100755 --- a/routes/infrastructure/construct.py +++ b/routes/infrastructure/construct.py @@ -56,6 +56,16 @@ def __init__( ), ) + if stage == "production" and veda_route_settings.domain_hosted_zone_name == "openveda.cloud": + cf_domain_names=[ + f"{stage}.{veda_route_settings.domain_hosted_zone_name}", + f"{veda_route_settings.domain_hosted_zone_name}" + ] + else: + cf_domain_names=[ + f"{stage}.{veda_route_settings.domain_hosted_zone_name}" + ] + self.distribution = cf.Distribution( self, stack_name, @@ -73,9 +83,7 @@ def __init__( default_root_object="index.html", enable_logging=True, web_acl_id=veda_route_settings.shared_web_acl_id, - domain_names=[ - f"{stage}.{veda_route_settings.domain_hosted_zone_name}" - ] + domain_names=cf_domain_names if veda_route_settings.domain_hosted_zone_name else None, ) @@ -112,9 +120,7 @@ def __init__( certificate=domain_cert, default_root_object="index.html", enable_logging=True, - domain_names=[ - f"{stage}.{veda_route_settings.domain_hosted_zone_name}" - ] + domain_names=cf_domain_names if veda_route_settings.domain_hosted_zone_name else None, )