title: Elastic Beanstalk Maximum Environment Variable Length
body: <p>I have difficulty trying to set up over 100 environment variables in my production Elastic Beanstalk running Django. The <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-softwaresettings.html#environments-cfg-softwaresettings-console" rel="nofollow noreferrer">AWS docs</a> mention that</p>
  <blockquote>
  <p>The combined size of all environment properties cannot exceed 4,096
  bytes when stored as strings with the format key=value.</p>
  </blockquote>
  <p>To my understanding there are 3 ways to set env vars in ELB.</p>
  <ol>
  <li><p>Through <code>eb cli</code> e.g <code>eb setenv key=value</code>(Doesn't work because it'll error out because of maximum length after reaching the maximum no. of characters)</p>
  </li>
  <li><p>Through the EB GUI Configuration &gt; Software &gt; Env variables (Doesn't work for the same reason above)</p>
  </li>
  <li><p>Through</p>
  <p>option_settings:</p>
  <ul>
  <li>option_name: CUSTOM_ENV
  value: staging</li>
  </ul>
  </li>
  </ol>
  <p>I imagine 3) would fail for the same reason too.</p>
  <p>I'm now experimenting with downloading my <strong>variables.env</strong> file from my S3 bucket and then replacing <strong>/opt/python/current/env</strong> with it</p>
  <pre><code>files:
    # Private key
    &quot;/opt/python/current&quot;:
      mode: &quot;000400&quot;
      owner: root
      group: root
      authentication: &quot;S3Auth&quot;
      source: ****/env
  </code></pre>
  <p>the idea being that ELB injects environment variables through that file. Unfortunately, the deployment errors out (permission error).</p>
  <p>Is there a way to circumvent the 4096 bytes limitation on ELB environment variables?</p>