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

fix(apis)!: overwrite api host when provided in config #245

Merged
merged 11 commits into from
Nov 9, 2023

Conversation

anayeaye
Copy link
Collaborator

@anayeaye anayeaye commented Nov 8, 2023

What

  • When a custom host is configured, overwrite the host in the api integration (bring back the parameter mapping method introduced in feat: add configuration for deploying a cloudfront distribution for the veda-backend #229)
  • Include origin_path in cloudfront ingest api behavior. Note: this path will not work until the root_path is changed to api/ingest in the ingest api
  • Domain construct now only generates custom subdomains for endpoints when configured (existing stacks must provide new configuration variable). Note: indentation changes that wrap all subdomain constructs make the change appear larger than they really are. The change removes an unused shared subdomain construct and only generates api-specific subdomains when create subdomains configuration is true.

Environment variable changes

New

VEDA_CUSTOM_DOMAIN optional configuration to provide a complete url for host overrides in lambda APIs (i.e. dev.somedomain.com)

Removed

VEDA_DOMAIN_SHARED_SUBDOMAIN is no longer used (logic is managed with custom subdomains config below)

New+Breaking

VEDA_DOMAIN_CREATE_CUSTOM_SUBDOMAINS boolean defaults false. Existing deployments with custom subdomains for each raster and stac api endpoints need to set this variable to TRUE.

@smohiudd
Copy link
Contributor

smohiudd commented Nov 9, 2023

For the domain construct can we remove:

            if veda_domain_settings.shared_subdomain:
                self.shared_sub_domain_name = aws_apigatewayv2_alpha.DomainName(
                    self,
                    "cfSharedApiCustomDomain",
                    domain_name=f"{stage}.{hosted_zone_name}",
                    certificate=certificate,
                )

                CfnOutput(
                    self,
                    "shared-sub-domain-name",
                    value=f"https://{stage}.{hosted_zone_name}/",
                )

self.shared_sub_domain_name isn't used in any of the other constructs.

@smohiudd smohiudd self-requested a review November 9, 2023 14:53
@anayeaye anayeaye requested a review from ividito November 9, 2023 17:44
@anayeaye anayeaye merged commit 7072ca2 into develop Nov 9, 2023
4 checks passed
@anayeaye anayeaye deleted the fix/configure-overwrite-host branch November 9, 2023 19:09
anayeaye added a commit that referenced this pull request Nov 13, 2023
…cloudfront (#244)

# What
- adds optional configuration to deploy all endpoints with a custom root
path (i.e. `/api/stac` and `/api/raster`) #229, #241
- adds support for using a cloudfront as a reverse proxy #229, #241,
#245
- titiler-pgstac upgraded from 0.2.3 to 0.8.0 #239
- titiler upgrade for custom colormap configuration #243

# How tested
A temporary test stack was deployed to confirm that raster-api works as
expected and that the two-subdomain staging-stac and staging-raster
pattern is still supported. The [pre-deploy diff action for this
pr](https://github.com/NASA-IMPACT/veda-backend/actions/runs/6791564314/job/18463354484#step:11:919)
confirms that the raster API lambda will be upgraded and no domain name
changes will be caused.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants