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: include stage subdomain in cloudfront distribution #237

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

smohiudd
Copy link
Contributor

The cloudfront distribution includes the stage env as the subdomain:

{stage}.{domain_hosted_zone_name}.com

@smohiudd smohiudd requested a review from anayeaye October 12, 2023 23:33
@smohiudd smohiudd marked this pull request as ready for review October 12, 2023 23:33
@smohiudd smohiudd changed the title fix: include subdomain stage in cloudfront distribution fix: include stage subdomain in cloudfront distribution Oct 12, 2023
Copy link
Collaborator

@anayeaye anayeaye left a comment

Choose a reason for hiding this comment

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

I added some discussion comments but no changes requested.

),
cache_policy=cf.CachePolicy.CACHING_DISABLED,
),
certificate=domain_cert,
domain_names=[veda_route_settings.domain_hosted_zone_name]
domain_names=[f"{stage}.{veda_route_settings.domain_hosted_zone_name}"]
if veda_route_settings.domain_hosted_zone_name
else None,
additional_behaviors={
"/api/stac*": cf.BehaviorOptions(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I missed this additional behaviors in the last PR, maybe we can drop a TODO here to make this configurable in the condition that a path prefex is used like f"{veda_route_settings.stac_path_prefix}*": cf.BehaviorOptions(.... I think we can work on that after using things for a while though, to see what our needs are

@@ -89,7 +90,7 @@ def __init__(
] = aws_apigatewayv2_alpha.ParameterMapping().overwrite_header(
"host",
aws_apigatewayv2_alpha.MappingValue(
veda_raster_settings.domain_hosted_zone_name
f"{stage}.{veda_raster_settings.domain_hosted_zone_name}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment for future work: maybe we can add a method in the api config files to add a stage subdomain for all non-prod stages? We don't need that now so it's just something to think about.

@smohiudd smohiudd merged commit f463791 into develop Oct 13, 2023
4 checks passed
@slesaad slesaad deleted the fix/cloudfront-subdomain branch July 26, 2024 16:57
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.

2 participants