How to send a flask application to AWS Elastic Beanstalk? - amazon-web-services

I am trying to deploy my website to Elastic Beanstalk in the console from AWS. The website structure is working perfect locally in my computer and has this structure:
- app.py
- Static --------- css --------- style.css
js --------- autocomplete.js
otherfiles.js
- Templates ----- index.html
the application app.py is an application in Flask sending the values of the variables to the index and the javascript files . I would like to make the webpage work in AWS, and, since the app.py has to be running all the time 24 hours, I have thought the best option is AWS Elastic Beanstalk. What I did was:
I created the environment
I uploaded my project in the console from AWS Elastic Beanstalk. According to what I read in other post from Stackoverflow, the best idea, is to upload the whole project on a zip file and then unzip it. I did it but all that I got is the message "Environment health has transitioned from Degraded to Severe. 100.0 % of the requests are failing with HTTP 5xx. ELB processes are not healthy on all instances. ELB health is failing or not available for all instances. Impaired services on all instances."
Does anybody know if I am heading in the right direction?
Thanks a lot

Check the beanstalk logs, you'll likely find information there that will help you determine what the problem is. I had a similar issue recently (although I was using the command line interface and not the console) and it turned out beanstalk was looking for "application.py" by default.

Related

Elastic Beanstalk 504 Gateway Timeout Error - Django

I recently completed the W3schools.com Django Tutorial. I followed it step by step. Everything works as expected locally. I also created and connected a PostgreSQL database on Amazon RDS to my app. Eventually I deployed the Django application to Elastic Beanstalk. Finally I visited the website and the homepage works, including 5 items added to the database during the tutorial which was migrated from the tutorial to the Amazon RDS. Unfortunately, neither the Django admin panel nor a simple subdirectory of the website are accessible. I get a 504 Gateway Time-out error. I don't know why. It is not clear from the logs what the issues might be. I am thinking it could possibly be a configuration file error or an incorrect value of settings.py on Django's side. Any help would be greatly appreciated.

502 bad gateway django elastic beanstalk

I got the django app deployed with elastic beanstalk on aws, I setup postgresql for it as well to work with one on aws. Unfortunately, following
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
I am getting 502 bad gateway after
eb open
I'm not really getting any errors, my app runs on local. I'm using the debug server, I also managed to run it on waitress. I was reading the oceans of info online and the only thing I can think of - do I need to actually deploy to a production server locally or can I just use EC2 for that? I'm learning about AWS as I go, so sorry if I'm not understanding something here :)
Thank you!

how to deploy MEAN stack app on AWS elastic beanstalk?

I'm trying to deploy my mean stack app on AWS using elastic beanstalk but there doesn't seem to be a tutorial good enough that can help me through it.
I would also like to know if I should really deploy it on elastic beanstalk or Lightsail?
Can you share any articles, videos or anything good enough to help me. It will be helpful to a lot of people.
Angular Version : 7
Node Version: 10.14.1
elastic beanstalk will be the option for production while you can use light sail for testing dev enviroment
now if we talk about the deploying Mean stack app
Open Elastic Bean stalk console and you will get option to choose Webserver
Choose web server with apache, tomcat, nginx, configure it as per your requirement
at last you will get option for upload your application
Upload your app using zip file (if dist folder is output then direct deploy dist in elastic beanstalk)

Django project on AWS elastic beanstalk always has health "severe" and CPU load 100%

I've developed a web app using python and django and have deployed it to AWS elastic beanstalk and have been having problems.
I followed this tutorial on how to deploy and followed the steps:
http://www.1strategy.com/blog/2017/05/23/tutorial-django-elastic-beanstalk/
The deployment worked for a couple of days and was reachable on the url given by elastic beanstalk, but today it stopped working and I noticed some weird log entries.
My health is always "severe" and my CPU load is always at 100% (user: 90+%)
here are the logs from elastic beanstalk:
https://pastebin.com/1KvSP6SJ
What is this /cpv, and why is there so many requests for it? At one point
there were +200 r/sec.
I also don't know what cpvfeed.50onred.com is. it is not my domain, nor am I
using any kind of advertising site.
Is this some sort of attack, or am I doing something wrong?
My website is not working and is giving me HTTP 408 and HTTP 504 errors.
How can I make my site reachable again, and bring the CPU down to a normal value. I should only have about 3-4 users at the moment, so I don't know where these +200 requests per second are coming from.
Please let me know if you need any more information.

How to setup AWS elastic beanstalk with windows server 2012

I'm new to AWS setup, and after having put quite a lot of time into researching an easy way to setup an instance on AWS for a .NET application, I finally decided to go with Elastic Beanstalk.
After creating an elastic beanstalk application (sample application), I need to upload my files and DB to that application and access it via an URL.
I haven't found a simple straight forward tutorial showing this. If someone has links to tutorial websites or have got this done, would like you know the process.
I've created a security group and added a keypair. Do i need to access it via SSH and install FTP and so on?
Help is appreciated.
-Adi.
There are some tutorial videos on .NET development and AWS Elastic Beanstalk available from the Amazon Web Services site here:
https://aws.amazon.com/visualstudio/