Skip to content

Commit 8735f45

Browse files
committed
fix: fall back to using api gateway url
1 parent d5d307f commit 8735f45

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
108108
ingestor_config = ingest_config(
109109
stage=veda_app_settings.stage_name(),
110110
stac_db_security_group_id=db_security_group.security_group_id,
111+
stac_api_url=stac_api.stac_api.url,
112+
raster_api_url=raster_api.raster_api.url,
111113
)
112114

113115
ingest_api = ingest_api_construct(

ingest_api/infrastructure/config.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,25 @@ class IngestorConfig(BaseSettings):
6565
description="Version of PgStac database, i.e. 0.5",
6666
)
6767

68-
custom_host: str = Field(
68+
stac_api_url: str = Field(
69+
description="URL of STAC API Gateway endpoint used to serve STAC Items"
70+
)
71+
72+
raster_api_url: str = Field(
73+
description="URL of Raster API Gateway endpoing used to serve asset tiles"
74+
)
75+
76+
custom_host: Optional[str] = Field(
6977
None,
7078
description="Complete url of custom host including subdomain. Used to infer url of apis before app synthesis.",
7179
)
7280

73-
stac_root_path: str = Field(
81+
stac_root_path: Optional[str] = Field(
7482
"",
7583
description="STAC API root path. Used to infer url of stac-api before app synthesis.",
7684
)
7785

78-
raster_root_path: str = Field(
86+
raster_root_path: Optional[str] = Field(
7987
"",
8088
description="Raster API root path. Used to infer url of raster-api before app synthesis.",
8189
)
@@ -97,15 +105,15 @@ def env(self) -> aws_cdk.Environment:
97105
)
98106

99107
@property
100-
def veda_stac_api_cf_url(self) -> Optional[str]:
108+
def veda_stac_api_cf_url(self) -> str:
101109
"""inferred cloudfront url of the stac api if app is configured with a custom host and root path"""
102110
if self.custom_host and self.stac_root_path:
103111
return f"https://{self.custom_host}{self.stac_root_path}"
104-
return None
112+
return self.stac_api_url
105113

106114
@property
107-
def veda_raster_api_cf_url(self) -> Optional[str]:
115+
def veda_raster_api_cf_url(self) -> str:
108116
"""inferred cloudfront url of the raster api if app is configured with a custom host and root path"""
109117
if self.custom_host and self.stac_root_path:
110118
return f"https://{self.custom_host}{self.raster_root_path}"
111-
return None
119+
return self.raster_api_url

0 commit comments

Comments
 (0)