Skip to content

URL issue with AWS Deployment #84

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

Closed
gbegkas opened this issue Feb 5, 2024 · 1 comment
Closed

URL issue with AWS Deployment #84

gbegkas opened this issue Feb 5, 2024 · 1 comment

Comments

@gbegkas
Copy link

gbegkas commented Feb 5, 2024

Hello, I am trying to deploy this project on AWS using API Gateway and Lambda through serverless.

I have modified the dockerfile to use the aws lambda base docker image and the app to access the Magnum handler, set up two endpoints in API Gateway, one for root and one for {proxy+} and manually setup up a pgstac using Aurora PostgreSQL.

Things work well and I can access the endpoints. The problem I am facing is that the root URL of API Gateway contains the stage and results in a URL like https://{api_Id}.execute-api.{region}.amazonaws.com/{stage}/ but the URLs generated from the STAC API are like this https://{api_Id}.execute-api.{region}.amazonaws.com/collections/ which don't work out of the box. Adding the stage by hand (e.g. https://{api_Id}.execute-api.{region}.amazonaws.com/{stage}/collections/) works with the exception of the api.html which is normal under the circumstance.

I have no experience with Fast API and every possible solution I found on the net didn't help.

I am sure that I am missing something. If needed I can post my dockerfile and serverless.yml.

Thanks in advance for any help.

@gbegkas
Copy link
Author

gbegkas commented Feb 5, 2024

Answering my own question to leave as a reference for anyone else that faces this issue in the future. Following this issue I added this app.root_path = '/dev' after app = api.app in pgstac/app.py. This can be improved to set the root path based on a env variable from serverless.yml.

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

No branches or pull requests

1 participant