Given the following considerations:
- Single S3 bucket containing static Frontend SPA files.
- Frontend is being served through CloudFront, where each tenant has their own CloudFront distribution (tenantA.domain.com, ... tenantZ.domain.com).
- Each tenant has their own configurations (which can be fetched from a Configuration service resolving the domain).
- Each CloudFront needs to inject such configurations in the Frontend at run time.
I am thinking of a Lambda function, that queries the "Configuration service" (possibly caching the response), and then setting globally scoped variables (e.g. window.config1) for the SPA to use. Is such a scenario possible through CloudFront? Is there a more common/standardized way?
