Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import eoapi-cdk constructs and reuse them #144

Merged
merged 15 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions infrastructure/aws/cdk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ def __init__( # noqa: C901
},
)

if eostac_settings.stac_browser_github_tag is not None:
if eostac_settings.stac_api_custom_domain_name is not None:
assert (
eostac_settings.stac_api_custom_domain_name is not None
), "stac_api_custom_domain_name must be set if stac_browser_github_tag is not None. The browser deployment needs a resolved STAC API url at deployment time and so needs to rely on a predefined custom domain name."
eostac_settings.stac_browser_github_tag is not None
), "stac_browser_github_tag must be set if stac_api_custom_domain_name is not None."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emileten can you explain again the relationship between the custom domain name and the GitHub tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, the way I wrote it, it's confusing.

In eoSTACSettings, I defined two parameters for the purpose of the STAC browser :

  • the catalog URL, which I named stac_api_custom_domain_name, that the browser is going to show
  • the version of the browser, stac_browser_github_tag

These two things should probably go in another configuration class named eoStacBrowserSettings for clarity.

And the assertion just checks that a version is provided if a catalog url is provided to avoid unclear errors downstream.

Does that make sense @vincentsarago ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

These two things should probably go in another configuration class named eoStacBrowserSettings for clarity.

That would be lovely

stac_browser_bucket = s3.Bucket(
self,
"stac-browser-bucket",
Expand Down
6 changes: 4 additions & 2 deletions infrastructure/aws/cdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ class eoSTACSettings(BaseSettings):

timeout: int = 10
memory: int = 256
stac_browser_github_tag: None | str = "v3.1.0" # if not none, will try to deploy this version of radiant earth stac browser
stac_api_custom_domain_name: None | str = "https://stac.eoapi.dev"
stac_browser_github_tag: None | str = "v3.1.0"
stac_api_custom_domain_name: None | str = (
None # if not none, will try to deploy a browser with the above tag
)
model_config = {
"env_prefix": "CDK_EOAPI_STAC_",
"env_file": ".env",
Expand Down