ERROR Invalid option specification - AWS Elasticbeanstalk - Django

Viewed 562

I am trying to set up my Django project using the AWS CLI service but I get the following error

ERROR   Invalid option specification (Namespace: 'aws:elasticbeanstalk:container:python', OptionName: 'StaticFiles'): Unknown configuration setting.

I work on Windows and follow these instructions: https://www.1strategy.com/blog/2017/05/23/tutorial-django-elastic-beanstalk/. This is from 2017 and I have already made some adjustments, as the AWS services is constantly being updated

But now something seems to be wrong in the python.config file. Maybe the name of the command has been changed. I couldn't find much about that anyway.

This is what my python.config file looks like:

container_commands:
  01_migrate:
    command: "python manage.py migrate"
    leader_only: true
  02_collectstatic:
    command: "python manage.py collectstatic --noinput"


option_settings:
  "aws:elasticbeanstalk:application:environment":
    DJANGO_SETTINGS_MODULE: "Whisky.settings"
    PYTHONPATH: "$PYTHONPATH"
  "aws:elasticbeanstalk:container:python":
    WSGIPath: "Whisky/wsgi.py"
    StaticFiles: "/static/=www/static/"

packages:
  yum:
    postgresql95-devel: []

I hope you can help me

1 Answers

The StaticFiles as well as the tutorial linked are for Amazon Linux 1 (AL1). However, the current versions of EB use Amazon Linux 2 (AL2). AL2 is likely what you are using now.

In AL2, such option is invalid and new options for static files should be used as shown here and here.

Please not that the tutorial is for AL1, and other things may also not work. There are many differences between AL1 and AL2.

Related