-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add ability to reload config at runtime #57
Comments
@gdey and I discussed this and we think the best way to accomplish this is to support an an endpoint (i.e. Thoughts? |
nice! |
Why a reload endpoint instead of reloading when the config file has changed? |
@JivanAmara we allow for remote configuration files (i.e. fetch a file on S3 or some other HTTP endpoint). This allows for easier management of a centralized config file across a cluster of servers instead of requiring the config to be reloaded on all servers. I need to document this. |
@ARolek Can you provide a brief example of how to do that? I've tried using the TEGOLA_CONFIG for AWS Lambda (pulling the config.toml file from a S3 Cloudfront distribution) and it doesn't seem to be working. Not sure if I'm overthinking it. |
Looks like it may be a CORS issue based on this line:
|
Is your lambda function running inside of a VPC? From the looks of it, the request is timing out, which happens after 10 seconds: If your function is in a VPC then you will need to configure the VPC to allow the lambda function to make public requests to the internet. Relevant article. |
Doh! You're right. Was able to connect directly to the S3 instance by allowing the VPC to connect to my S3 endpoint. Sorry for my ignorance and thanks again for your patience! |
@stdmn beautiful! I'm glad it's working for you! If you have any suggestions to help make the instructions easier to follow, feel free to send in a PR with any documentation updates. This is an interesting "gotcha" that is not currently documented. |
@ARolek One related question, it seems that when I change the S3 config object but don't update the Lambda function, Lambda doesn't recognize that the config file has been changed and retains some kind of cache on the previous config file. As far as I can tell, this is server side, not client side (tested with clearing cache and using incognito). When I remove the TEGOLA_CONFIG save and then re-add with the same config location it will update. Any idea how to invalidate in order to make sure that the Lambda function is pulling the new S3 config? Sorry, I recognize this stuff is somewhat out of your jurisdiction, but my goal is to hot-swap the config file when a user uploads a new table to a DB to add the new uploaded layer. |
UPDATE: seems that it's on the API Gateway (unsurprisingly): https://stackoverflow.com/questions/39303410/can-aws-api-gateway-cache-invalidate-specific-entries-based-on-the-response-cont. Still working on a solution. |
@stdmn you could also look into not using API Gateway now that Application Load Balancers can Invoke Lambda Functions. |
This is required to support changing a configuration file during development.
If possible, Tegola should finish serving existing requests with the old config and serve new requests with the new config.
The text was updated successfully, but these errors were encountered: