amazon-elastic-beanstalk

Deploying Python FastAPI to AWS Beanstalk

Deploying Python FastAPI to AWS Beanstalk Question: I have a small python FastAPI project which is completely working on my local computer. But when I try to deploy it to AWS Beanstalk (manually for now) I’ve always got a ‘502 Bad Gateway’ error when open the application in a browser. This is my project structure: …

Total answers: 1

How to find my current nginx.conf file from the AWS EC2 Enviroment

How to find my current nginx.conf file from the AWS EC2 Enviroment Question: I need to modify nginx.conf to increase client_max_body_size . On the AWS docs . Here they are giving an example of how to modify the configuration . but they are doing a lot more things that I don’t want to do that. …

Total answers: 1

Run migrations on Dockerfile deploying on Elastic Beanstalk

Run migrations on Dockerfile deploying on Elastic Beanstalk Question: I have a problems making migrations (Django App 4.0.6) on Elastic beanstalk. This is my Dockerfile: FROM python:3.8 ENV PROJECT_DIR=/usr/src/app/ ENV PYTHONIOENCODING=utf-8 ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV PIPENV_USE_SYSTEM=1 WORKDIR ${PROJECT_DIR} COPY . ./ RUN pip install -r requirements.txt EXPOSE 8000 CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] Until …

Total answers: 1

Can't use opencv with a flask server on elastic beanstalk

Can't use opencv with a flask server on elastic beanstalk Question: So I’m running a very basic elastic beanstalk server. It’s a python version 3.7(and tried on 3.8) server using linux 2. I tried putting up a simple server with an application.py that looks like this: from flask import Flask import cv2 application = Flask(__name__) …

Total answers: 2

Environment properties are not passed to application in Elastic Beanstalk

Environment properties are not passed to application in Elastic Beanstalk Question: When deploying my Django project, database settings are not configured because ‘RDS_HOSTNAME’ in os.environ returns false. In fact no environment properties are available at the time of deployment. All these properties are available after the deployment. Running /opt/elasticbeanstalk/bin/get-config environment returns following: {"DJANGO_SETTINGS_MODULE":"myApp.settings","PYTHONPATH":"/var/app/venv/staging-LQM1lest/bin:$PYTHONPATH","RDS_DB_NAME":"ebdb","RDS_HOSTNAME":"xxxx.amazonaws.com","RDS_PASSWORD":"xxxx","RDS_PORT":"xxxx","RDS_USERNAME":"xxxx"} All RDS …

Total answers: 3

No module named 'application' Error while deploying simple web app to Elastic Beanstalk

No module named 'application' Error while deploying simple web app to Elastic Beanstalk Question: I am deploying a web app to elastic beanstalk using this tutorial and the same ‘application.py’ file they have: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html#python-flask-setup-venv I get a 502 error when going to the site, and degraded/severe health on the environment. When I check the logs, …

Total answers: 4

Changing MySQL isolation level on Django/Elastic beanstalk/RDS

Changing MySQL isolation level on Django/Elastic beanstalk/RDS Question: I’m trying to change the isolation level of my MySQL instance on RDS through a Django application. I’ve followed the recommendation here So, I changed my Django db settings to: ‘OPTIONS’: { ‘init_command’: ‘SET default_storage_engine=INNODB; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED’ } This command works fine …

Total answers: 3

Unable to install AWS Elastic Beanstalk CLI (Win10, Python 3.6, Pip 9.0.1)

Unable to install AWS Elastic Beanstalk CLI (Win10, Python 3.6, Pip 9.0.1) Question: I am trying to install awsebcli on my machine and I am unable to run the command eb –version It shows this error: ‘eb’ is not recognized as an internal or external command, operable program or batch file. This is my Python …

Total answers: 10

Where is the cfnbootstrap folder?

Where is the cfnbootstrap folder? Question: I’m curious about some AWS internals – I don’t have an actual issue, I just want to learn more about this. I’m running Beanstalk with Windows instances. I was poking around some logs in c:cfn and in "C:cfnlogcfn-init.log" and I found some lines like this: File "cfnbootstraputil.pyc", line 159, …

Total answers: 1

How to force application version on AWS Elastic Beanstalk

How to force application version on AWS Elastic Beanstalk Question: I’m trying to deploy a new version of my Python/Django application using eb deploy. It unfortunately fails due to unexpected version of the application. The problem is that somehow eb deploy screwed up the version and I don’t know how to override it. The application …

Total answers: 3