'Moodle on Heroku using S3 Bucket

I'm trying to set up Moodle on a free Dyno on Heroku.

On config.php:

I created the folder moodledata, added an image to it and I was able to access it from the browser (for example https://mys3bucketnamexample.s3.eu-north-1.amazonaws.com/moodledata/ola.png)

BUT I'm getting "Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting." when the app is deployed to Heroku.

What am I doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source