AWS Classroomnotes 21/Feb/2022

Deploying a Python Webapp (Flask) to elastic beanstalk

  • Lets create an IAM user with programmatic access (cli or sdk).
  • Refer Here for creating IAM user
  • Install AWS ClI
  • Refer Here for video demonstration
  • Refer Here
  • After AWS Installation & Configuring IAM User on AWS CLI
aws configure

* Install elastic beanstalk cli Refer Here. We will be using the manual approach Refer Here
* Install Python
* Windows choco install python or Refer Here
* mac brew install python@3.9
* Now install ebcli using pip install awsebcli --upgrade --user
* Now add eb to the path Refer Here
* Refer Here for the code used in the sample application
* Now run the application locally flask run
* Now lets try to deploy this to the elastic beanstalk using eb cli Refer Here for the basic command help and documentation
* Now execute eb platform list --region us-west-2 and we selected python-3.8
* Now navigate to your project root folder and execute eb init sample-flask-app -p python-3.8 --region us-west-2
* Now Create an environment and deploy the application with eb create
* Once your deployment is succesfull, we can open our application using eb open
* with eb cli commands we are able to create environment and application version from cli
* As of now health is degraded, which we will fix in our next session
* To clean up eb terminate sample-flask-app

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner