feat: cloudfront cdn support for aws provider
Description
Add Cloudfront support for AWS. A new setting is supported GROVE_ENABLE_CLOUDFRONT
. If enabled, Grove will create Cloudfront
resources and modify the STATIC_URL
's for the CDN and LMS so that all requests go through the CDN.
Digital Ocean doesn't provide a similar service, so this feature is AWS only. In the future, we can add Cloudflare's CDN to have a general solution.
Supporting information
Testing instructions
Steps to test the changes:
- Proofread the code.
- Visit https://lms.keith-grove-test.stage.opencraft.hosting/ and verify that static files are served by the CDN.
- Visit https://studio.keith-grove-test.stage.opencraft.hosting/ and verify that static files are served by the CDN.
- Log in as a user and verify that for any MFE, that the static assets are loaded from Cloudfront.
This can be checked by verifying that the network request has a
via
response header
Caveats
Enabling Cloudfront for MFE's is not enabled by default, because of the large number of manual steps required.
Checklist
If any of the items below is not applicable, do not remove them, but put a check in it.
-
All providers include the new feature/change -
All affected providers can provision new clusters -
Unit tests are added/updated -
Documentation is added/updated -
The TOOLS_CONTAINER_IMAGE_VERSION
in ci_vars.yml is updated -
The grove-template repository is updated
Edited by Keith Grootboom