Help us understand the problem. What is going on with this article?

【AWS】ebでPython環境構築してみた Flaskアプリケーションデプロイ編【Elastic Beanstalk】

More than 3 years have passed since last update.

http://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/create-deploy-python-flask.html
に沿って作業していきます

前提条件

【AWS】ebでPython環境構築してみた Flaskアプリケーションデプロイ準備編の内容が終わっている

要は以下4つが使えればOK

  • Python 2.7
  • pip
  • virtualenv
  • awsebcli

EBCLIの導入

Macに Homebrew を使用して導入します

コマンド
brew install awsebcli
確認
eb --version
結果
EB CLI 3.7 (Python 2.7.1)

EB CLI でサイトをデプロイする

変数
VIRTUAL_ENV_NAME='eb-test-Flask'
コマンド
VIRTUAL_ENV_NAME='eb-test-Flask'
PJ_DIR_NAME='eb-flask'
cd ~/${VIRTUAL_ENV_NAME}/${PJ_DIR_NAME}
pwd
結果
/Users/****/eb-test-Flask/eb-flask
コマンド
eb init -p python2.7 flask-tutorial
結果
You have not yet set up your credentials or your credentials are incorrect 
You must provide your credentials.
(aws-access-id): ***************** ←クレデンシャルを入力
(aws-secret-key): **************** ←クレデンシャルを入力
Application flask-tutorial has been created.

コンソールで確認するとできている(この手順そのままなぞると多分オレゴンに出来ます)

Elastic_Beanstalk.jpg

pemキーの準備

コマンド
eb init
結果
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.
コマンド
eb create
結果
Enter Environment Name
(default is flask-tutorial-dev): flask-env
Enter DNS CNAME prefix
(default is flask-env):

これで処理が走るのでしばらく待ちます

コマンド
eb open

このコマンド打った後も実際にサイトが見れるようになるまで少し時間がかかります。
Elastic_Beanstalk_アプリケーション.jpg

URLを使用してサイトに接続すると手元でやったのと同じ環境が構築されているはずです。

リソースの削除

コマンド
eb terminate flask-env
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした