0

I am new to AWS CLI USAGE. So do explain me the error clearly so that i don't make that mistake next time.

Here is my requirements.txt file :

    appdirs==1.4.3
    cssselect==1.0.1
    dj-database-url==0.4.2
    Django==1.11
    django-ckeditor==5.2.2
    Markdown==2.6.8
    packaging==16.8
    psycopg2==2.5.4
    pyparsing==2.2.0
    pytz==2017.2
    six==1.10.0

Here are my files inside .ebextensions directory :

  • django.config

    option_settings:
      "aws:elasticbeanstalk:application:environment":
        DJANGO_SETTINGS_MODULE: "awsbean.settings"
      aws:elasticbeanstalk:container:python:
        WSGIPath: cv_web/wsgi.py
    
  • packages.config

    packages:
      yum:
        git: []
    
  • python.config

    container_commands:
       01_migrate:
        command: "python src/manage.py migrate --noinput"
        leader_only: true
    

And here is my config.yml file inside .ebextensions/.elasticbeanstalk :

 branch-defaults:
     default:
        environment: environment
    environment-defaults:
      environment:
        branch: null
        repository: null
    global:
      application_name: cv_web
      default_ec2_keyname: aws-eb2
      default_platform: Python 3.4
      default_region: ap-south-1
      instance_profile: null
      platform_name: null
      platform_version: null
      profile: eb-cli
      sc: null
      workspace_type: Application
Akshat Uppal
  • 21
  • 2
  • 9

1 Answers1

2

There is a known issue with psycopg2 on AWS. You have to manually sudo install it.

What I usually do is I include the psycopg2 install (reqires installing postgressql-devel first) in .ebextensions so to make sure it's available before requirements.txt kicks off.

Include this in your config file:

container_commands:
  01_postgresql:
    command: sudo yum -y install gcc python-setuptools python-devel postgresql-devel
  02_postgresql:
    command: sudo easy_install psycopg2
morinx
  • 635
  • 7
  • 19