Fix/separate app stack settings#50
Conversation
|
📚 Documentation preview will be available at: https://developmentseed.github.io/titiler-cmr/pr-previews/pr-50/ Status: ✅ Preview is ready! |
|
I have verified this is now working via this tile request and visiting the API docs landing page. It does seem a bit duplicative that TITILER_CMR_ROOT_PATH is defined by AppSettings in infrastructure/aws/config.py in order to be passed as an environment variable to the lambda run time for use ApiSettings in titiler/cmr/main.py but I haven't thought of a better way to pass environment variables between the stack deployment and the app run time... |
hrodmn
left a comment
There was a problem hiding this comment.
It does seem a bit duplicative that TITILER_CMR_ROOT_PATH is defined by AppSettings in infrastructure/aws/config.py in order to be passed as an environment variable to the lambda run time for use ApiSettings in titiler/cmr/main.py but I haven't thought of a better way to pass environment variables between the stack deployment and the app run time...
Agreed. The number of variable handoffs is a little out of control especially when you go all the way up to the veda-deploy level! I did not try experimenting with the whole custom host and root path situation when I did this in titiler-multidim - I just followed some example from a different veda service.
I guess we could eliminate the infrastructure AppSettings and just load things directly from env vars at deploy time, but the pydantic settings are a convenient interface for validation and defining defaults. I think we are stuck with the env var -> settings in the titiler-cmr application since we don't compile the app to encode these variables in the runtime.
Add root_path and veda_custom_host to replicate developmentseed/titiler-multidim#87