Drupal with S3 on Elastic Beanstalk - AWS
This tutorial uses S3FS-FUSE and AWS Elastic Beanstalk to make sure that your Drupal installation, after each deployment, connects to your S3 storage and uploads all static content (such as images) right there.
This tutorial is based on Matt Zuba's post <s3fs-fuse and AWS Elastic Beanstalk> in which he connected Wordpress with S3, which of course we tweaked it a bit to suit our needs.
As Matt says, the obvious choice for centralized resource storage is AWS S3. The unobvious choice is how to go about it. We personally tried a few different extensions to suit our needs in Drupal (such as Amazon S3), but they always failed for some reason or another. What this configuration achieves, is it mounts an S3 bucket as a local folder on the file system. This seemed like the perfect solution.
You'll find below the config file. Simply add an Access Key to your Elastic Beanstalk configuration (one that has access to the bucket you’re referencing), replace the bracketed options with your specific Access Key, Secret Key and AWS Bucket name; make sure your Drupal configuration saves the files in \sites\default\files\s3 and drop this file into your .ebextensions folder. All you have to do afterwards is just deploy it to your Beanstalk environment.
PS: We had big problems saying that "s3fs: could not determine how to establish security credentials.". We fixed it by simply rendering another access key/secret (and another, and another, and another...) until AWS gave us one without ANY symbols. That one finally worked :-)
Final notes
Need help implementing this?
Feel free to contact us using this form or via email at