[AWS] Flask application deployment version that tried to build a Python environment with eb [Elastic Beanstalk]

http://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/create-deploy-python-flask.html I will work along with

Prerequisites

[AWS] Flask application deployment preparation for building Python environment with eb is over

In short, it is OK if you can use the following 4

Introduction of EBCLI

Deploy using Homebrew on Mac

command


brew install awsebcli

Verification


eb --version

result


EB CLI 3.7 (Python 2.7.1)

Deploy the site with the EB CLI

variable


VIRTUAL_ENV_NAME='eb-test-Flask'

command


VIRTUAL_ENV_NAME='eb-test-Flask'
PJ_DIR_NAME='eb-flask'
cd ~/${VIRTUAL_ENV_NAME}/${PJ_DIR_NAME}
pwd

result


/Users/****/eb-test-Flask/eb-flask

command


eb init -p python2.7 flask-tutorial

result


You have not yet set up your credentials or your credentials are incorrect 
You must provide your credentials.
(aws-access-id): *****************← Enter credentials
(aws-secret-key): ****************← Enter credentials
Application flask-tutorial has been created.

You can check it on the console (you can probably go to Oregon by tracing this procedure as it is)

Elastic_Beanstalk.jpg

pem key preparation

command


eb init

result


Do you want to set up SSH for your instances?
(y/n): y

Type a keypair name.
(Default is aws-eb): eb-test-yuki
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/****/****/eb-test-hoge.
Your public key has been saved in /Users/****/****/eb-test-hoge.pub.
The key fingerprint is:

The key's randomart image is:

WARNING: Uploaded SSH public key for "eb-test-hoge" into EC2 for region us-west-2.

command


eb create

result


Enter Environment Name
(default is flask-tutorial-dev): flask-env
Enter DNS CNAME prefix
(default is flask-env):

This will run the process, so wait for a while

command


eb open

Even after typing this command, it will take some time before you can actually see the site. Elastic_Beanstalk_アプリケーション.jpg

When you connect to the site using the URL, you should have the same environment as you did at hand.

Delete resource

command


eb terminate flask-env

Recommended Posts

[AWS] Flask application deployment version that tried to build a Python environment with eb [Elastic Beanstalk]
[AWS] Flask application deployment preparation edition that tried to build a Python environment with eb [Elastic Beanstalk]
[AWS] Development environment version that tried to build a Python environment with eb [Elastic Beanstalk]
I tried to build a Mac Python development environment with pythonz + direnv
[ES Lab] I tried to develop a WEB application with Python and Flask ②
Build a machine learning application development environment with Python
How to build a python2.7 series development environment with Vagrant
A note that deployed a Python application from Circle CI to Elastic Beanstalk and notified Slack
Build a Flask / Bottle-like web application on AWS Lambda with Chalice
[Python] A memo that I tried to get started with asyncio
I tried to make a 2channel post notification application with Python
I tried to make a todo application using bottle with python
I want to build a Python environment
Build a python virtual environment with pyenv
Build a modern Python environment with Neovim
A memo that allows you to change Pineapple's Python environment with pyenv
I tried to discriminate a 6-digit number with a number discrimination application made with python
Build a WardPress environment on AWS with pulumi
Build a python environment with ansible on centos6
[Python] Build a Django development environment with Docker
Create a python3 build environment with Sublime Text3
Build a Python environment with OSX El capitan
Quickly build a Python Django environment with IntelliJ
Build a Python machine learning environment with a container
Build a python execution environment with VS Code
I tried to make a simple mail sending application with tkinter of Python
When I tried to create a virtual environment with Python, it didn't work
I tried to build an environment with WSL + Ubuntu + VS Code in a Windows environment
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
Build a python virtual environment with virtualenv and virtualenvwrapper
I tried to draw a route map with Python
Build a python environment for each directory with pyenv-virtualenv
How to build a Django (python) environment on docker
[No need to build local environment] Deploy Python bottle application made with Cloud9 to Heroku
[Go + Gin] I tried to build a Docker environment
A server that echoes data POSTed with flask / python
Build a python virtual environment with virtualenv and virtualenvwrapper
I tried to automatically generate a password with Python3
Script to easily create a client device environment for AWS IoT (Python v2 version)
How to build a Python environment on amazon linux 2
I tried to build an environment for machine learning with Python (Mac OS X)
[1 hour challenge] I tried to make a fortune-telling site that is too suitable with Python
I tried uploading / downloading a file to AWS S3 / Azure BlobStorage / GCP CloudStorage with Python
I tried to make a generator that generates a C # container class from CSV with Python
I tried to build a service that sells machine-learned data at explosive speed with Docker
I wrote a script to create a Twitter Bot development environment quickly with AWS Lambda + Python 2.7
How to build a new python virtual environment on Ubuntu
How to convert an array to a dictionary with Python [Application]
I made a simple book application with python + Flask ~ Introduction ~
From environment construction to deployment for flask + Heroku with Docker
Build a Python environment and transfer data to the server
Build a python environment with pyenv (OS X El Capitan 10.11.3)
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
Build python3 environment with ubuntu 16.04
Build python environment with direnv
Build a Python environment offline
Web application with Python + Flask ② ③
Web application with Python + Flask ④
Learning history to participate in team application development with Python ~ Build Docker / Django / Nginx / MariaDB environment ~
A story that didn't work when I tried to log in with the Python requests module
Create a Python3.4 + Nginx + uWSGI + Flask Web application execution environment with haste using pyenv on Ubuntu 12.04