CloudFront
This guide explains how to host addressables on AWS CloudFront which is actually almost identical to the one HoloFair team uses internally to deliver clients custom projects globally.
Last updated
This guide explains how to host addressables on AWS CloudFront which is actually almost identical to the one HoloFair team uses internally to deliver clients custom projects globally.
Last updated
Requirements:
AWS Account with basic write and read access to S3 and CloudFront. In CloudFront, make sure you are able to access invalidations tab.
Public S3 bucket where you can freely delete, upload and read files from the console, where also each file can be publicly downloaded
One CloudFront distribution connected to the S3 bucket. Note the distribution domain name (e.g. https://d3nycf6vcruyvx.cloudfront.net/)
1) In Unity3D project go to Asset Management -> Addressables -> Profiles, create a new profile and name it as you wish (e.g. CloudFront). Then in use recommended values below:
Key | Value |
---|---|
2) If you use this values, then you are required to set properly a Product Name in Player Settings
3) Then, assuming you added the addressable correctly already, it is okay to make first new build of addressables, which will be compiled to this directory: PROJECT-ROOT-DIRECTORY/ServerData/CloudFront/addressables/[UnityEngine.Application.unityVersion]/[UnityEngine.Application.productName]/[BuildTarget]
4) After that if you have updates, make sure you "Update Addressables" instead. Unless, you are using different Addressable Profile or the current one was changed somehow. In such cases Unity3D will throw an error that the paths are not matching.
5) Once the files are compiled, go to AWS Console -> S3 -> Your public bucket -> Addressables (Create a directory if it doesn't exist) -> and drag and drop content PROJECT-ROOT-DIRECTORY/ServerData/CloudFront/addressables/ directory to there, which should be only one folder named 2021.3.1f1.
6) Then in case if you are updating addressables, go to AWS Console -> S3 -> Your public bucket -> Addressables -> 2021.3.1f1 ->Your product name that you specified in Unity3D Player Settings -> WebGL and this is where you need uploaded updated files from you local folder where addressables have been compiled, i.e. from PROJECT-ROOT-DIRECTORY/ServerData/CloudFront/addressables/2021.3.1f1/Your product name that you specified in Unity3D Player Settings/WebGL.
7) Also whenever updated, you will need to invalidate the files or folder which you updated. For this, please, see how to Invalidate files in AWS CloudFront.
8) Now, the most important output of this process is WebGL catalog json file of the addressable. This file is located in AWS Console -> S3 -> Your public bucket -> Addressables -> 2021.3.1f1 ->Your product name that you specified in Unity3D Player Settings -> WebGL -> catalog_yyyy.mm.dd.hh.mm.ss.json.
9) Copy the link from the S3 and make sure to replace domain name by your CloudFront distribution domain name. After that this url needs to be used when creating a private template in HoloFair system. See Pubish & Test your Metaverse
RemoteBuildPath
ServerData/CloudFront/addressables/[UnityEngine.Application.unityVersion]/[UnityEngine.Application.productName]/[BuildTarget]
RemoteLoadPath