Skip to content

Commit

Permalink
fix: update domain names to support multiple domain names for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
botanical committed Aug 8, 2024
1 parent 69e8227 commit 313b7c7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions routes/infrastructure/construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit 313b7c7

Please sign in to comment.