amazon-web-servicesamazon-elastic-beanstalkebextensions

Configuring static files settings for Docker on Amazon Linux 2 ends with the error


When doing any kind of attempts for aws:elasticbeanstalk:environment:proxy:staticfiles it just doesn't work. Every time I receive errors about invalid option specification. All the rest of ebextensions settings work like a charm.

Example snippet that I try:

option_settings:
  aws:elasticbeanstalk:environment:proxy:staticfiles:
    /stylesheets: public/stylesheets
    /fonts: public/fonts
    /html: public/html

Error on eb deploy:

2021-04-09 08:12:02    ERROR   "option_settings" in one of the configuration files failed validation. More details to follow.
2021-04-09 08:12:02    ERROR   Invalid option specification (Namespace: 'aws:elasticbeanstalk:environment:proxy:staticfiles', OptionName: '/stylesheets'): Unknown configuration setting.
...

Running EB platform with Docker on 64bit Amazon Linux 2, version 3.2.6. I start suspecting this staticfiles spec is unsupported on this platform for any reason but I crawled through AWS EB documentation seeking for any hints with no success. Interestingly, there is no static files section in the web console UI either.

I tried every configuration flavors - trailing slashes, quotation, different sets of those paths... Nothing worked.


Solution

  • staticfiles are not supported for Docker platforms. From docs:

    Elastic Beanstalk supports configuring the proxy to serve static files on most platform branches based on Amazon Linux 2. The one exception is Docker.