1

I have a config file in my projects's .ebextensions directory containing

option_settings:
  "aws:elasticbeanstalk:container:python:staticfiles":
    "/static/": "sitetest/static/"

but my EB environment does not change the setting for /static/ in response to this being pushed to AWS.

I can verify that other config settings in the same directory — e.g. for environment variables using

option_settings:
  "aws:elasticbeanstalk:application:environment":
    SOME_VAR: "foo"

or for container commands using

container_commands:
  00_syncdb:
    command: "python manage.py db upgrade"
    leader_only: true

behave as expected.

Why isn't AWS Elastic Beanstalk's static path changing when to correspond to the setting in my config file?

orome
  • 45,163
  • 57
  • 202
  • 418

1 Answers1

3

The ebextensions are a lower precedence setting. What this means is that if you ever set anything in your ebextensions using the cli/console/api, the ebextension will no longer take effect.

You can remove the setting using the cli/api in order to get the ebextension to work again.

Using the EB CLI you can use eb config then remove the related line from the file.

Using the AWS CLI you can use:

aws elasticbeanstalk update-environment --environment-name MyEnvName --region us-west-2 --options-to-remove Namespace=aws:elasticbeanstalk:container:python:staticfiles,OptionName=/static/
Nick Humrich
  • 14,905
  • 8
  • 62
  • 85
  • I'm no sure I follow. There's no way in the Console to remove the setting for `/static/`; I want to use my `.ebextensions/....config` file to set it. – orome Jan 20 '15 at 00:38
  • @raxacoricofallapatorius Unfortunately no, there is no way in the console. But you only need to unset it once. (and make sure to never set it again using the console). Or, you can just set it using the console. **The ebextension will work if you create a brand new environment.** – Nick Humrich Jan 20 '15 at 00:42
  • Before I edit the scary file with `eb config`, and for reference: Is this happening because the setting I'm trying to change (`aws:elastic beanstalk:container:python:static files:`) is overridden by a *different* one: `aws:elastic beanstalk:container:python`, `StaticFiles`? Is that latter setting (and not the former) what I'm seeing in the Console? Could I change *both* in config my config files? Do I need to delete both to get things working? – orome Jan 20 '15 at 01:37
  • 3
    Is the fact that the Console setting can't be overridden (that it causes config settings to be *ignored*, apparently without logging) documented anywhere? – orome Jan 20 '15 at 14:54
  • @orome Is the `StaticFiles` setting in `aws:elasticbeanstalk:container:python` documented anywhere? It's not on [the AWS docs](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-specific.html#command-options-python) and the only place I've seen it so far is your comment and in the `eb config` file. – Daisy Leigh Brenecki Oct 10 '17 at 00:54