[PYTHON] Create an AWS Cloud9 development environment on your Amazon EC2 instance

table of contents

  1. Overview
  2. Launch AWS Cloud9
  3. Try using Python on AWS Cloud9

1. Overview

I want a development environment, but it is troublesome to set up the Server one by one. .. AWS Cloud9 is convenient for you.

You can start writing code immediately without setting up Server!

Reference: AWS Cloud9

AWS Cloud9 is a cloud-based integrated development environment (IDE) that allows you to write, execute, and debug code in a browser only. It includes a code editor, debugger and terminal. Cloud9 comes pre-packaged with essential tools for popular programming languages such as JavaScript, Python, and PHP, so you'll need to install files and set up your development machine to start a new project. there is no.

Screen Shot 2020-07-09 at 23.18.54.png

2. Launch AWS Cloud9

If you do not have an AWS account, please refer to this Qiita article and create one. How to create an AWS free account

2-1. Log in to the AWS Management Console

Access the URL below https://console.aws.amazon.com/

Screen Shot 2020-07-09 at 23.23.33.png

2-2. Change Region (if necessary)

Personally, I like the "Tokyo" Region, so I'll change it from the Default "Ohio". Screen Shot 2020-07-09 at 23.23.43.png

Safely changed to "Tokyo" Screen Shot 2020-07-09 at 23.28.27.png

2-3. Click Cloud9

Click "Services" in the upper left Screen Shot 2020-07-09 at 23.30.32.png

A list of services comes out like this Screen Shot 2020-07-09 at 23.32.09.png

Scroll to the bottom and click on "Cloud9" in the "Developer Tools" section. Screen Shot 2020-07-09 at 23.33.29.png

A screen like this will appear (Japanese page is not supported, English page) Screen Shot 2020-07-09 at 23.34.45.png

2-4. Create Cloud9 environment

Click "Create environment" Screen Shot 2020-07-09 at 23.36.08.png

Transition to such a page Screen Shot 2020-07-09 at 23.37.43.png

Enter "Name" and "Description" and click "Next step" so that you can see what the Cloud9 environment is for. Screen Shot 2020-07-09 at 23.44.07.png

Transit to the environment setting screen Screen Shot 2020-07-09 at 23.47.09.png

Set according to your environment

This time, I want to demo with a free frame, so select the "t2.micro" instance Also, if the OS is Linux, there is no particular preference, so select "Amazon Linux"

For the cost-saving setting, there are times when you want to turn the process behind the scenes, so if you do not want to go down without permission when you are not connected, set "Never" Screen Shot 2020-07-09 at 23.51.56.png

Click "Next step" Screen Shot 2020-07-09 at 23.53.08.png

Make a final confirmation of the settings and click "Create environent" Screen Shot 2020-07-09 at 23.54.17.png

Like this, it will create a Cloud9 environment (wait for 2-3 minutes in this state) Screen Shot 2020-07-09 at 23.55.41.png

Cloud9 environment is ready! Screen Shot 2020-07-09 at 23.57.13.png

3. Try using Python on AWS Cloud9

3-1. Check the version of python with bash

Enter the following command on the Console screen at the bottom As of 2020-07-10, it seems that Python 3.6.10 is included by default.

Terminal


python -V
Screen Shot 2020-07-10 at 00.02.36.png

You can also open the terminal screen from the tab ezgif-4-52a91dfef452.gif

3-2. Create a python file

Press "+" on the tab to create a New File Screen Shot 2020-07-10 at 00.17.34.png

Click File-> Save as Screen Shot 2020-07-10 at 00.19.37.png

Set an appropriate name and click "save" Screen Shot 2020-07-10 at 00.20.55.png

Screen Shot 2020-07-10 at 00.21.56.png

Write your own Code This time it is for testing, so execute it with the following code

qiita_python.py


print('hello world')
a = 1 + 2 - 3 * 4 
print(a)
Screen Shot 2020-07-10 at 00.24.16.png

3-3. Execute the created python for Demo

Click "Run" ezgif-4-e7ebfc3eed8f.gif

Summary

Like this, AWS Cloud9 is highly recommended because it makes it easy to create a development environment. Please give it a try!

Recommended Posts

Create an AWS Cloud9 development environment on your Amazon EC2 instance
Creating an AWS EC2 EC2 Instance (Amazon Linux AMI) 2
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
Deployment procedure on AWS (2) Server (EC2 instance) environment settings
Create an environment for MkDocs on Amazon Linux (attempted)
Building an environment to execute python programs on AWS EC2
I tried to create an environment of MkDocs on Amazon Linux
# 3 Build a Python (Django) environment on AWS EC2 instance (ubuntu18.04) part2
Building an environment to run ChainerMN on a GPU instance on AWS
Create a python environment on your Mac
Build an LNPP environment on Amazon Linux 2
Create an OpenCV3 + python3 environment on OSX
I easily built an operating environment for Python3 + Tornado on AWS EC2.
Prepare the environment of Chainer on EC2 spot instance with AWS Lambda
code-server online environment (4) Launch code-server on the EC2 instance
Python development on Ubuntu on AWS EC2 (using JupyterLab)
Build a Python development environment on your Mac
Create an AWS GPU instance to train StyleNet
Set up an Objective-C 2.0 development environment on Linux
Create a Python virtual development environment on Windows
Prepare the development environment for Python on AWS Cloud9 (pip install & time change)
Build a TensorFlow development environment on Amazon EC2 with command copy and paste
code-server online environment (3) Launch an EC2 instance with Boto3
Create an Anaconda virtual environment in your project folder
Create Amazon Linux with AWS EC2 and log in
Create a comfortable Python 3 (Anaconda) development environment on windows
PySpark: Set up PySpark on your Alibaba Cloud CentOS instance
AWS EC2 2nd SSH connection to EC2 Instance (Amazon Linux2)
Create an OpenAI Gym environment with bash on Windows 10
[AWS EC2] How to install Maven on Amazon Linux 2
Create a Python development environment on OS X Lion
[AWS] Install node.js on EC2 instance and execute sample program
Create a Python (pyenv / virtualenv) development environment on Mac (Homebrew)
Create a VS Code + Docker development environment on a Linux VM
Build Keras environment on AWS E2 G2 instance February 2017 version
[AWS EC2] Settings you want to do on Amazon Linux 2
Launch NEM Symbol testnet node on AWS EC2 (Amazon Linux2)
Create an environment with virtualenv
Organize your Python development environment
Django environment development on Windows 10
Add users with SSH access to your Amazon EC2 Linux instance
Prepare Python development environment on Ubuntu
Create a Python environment on Mac (2017/4)
Use jupyter on AWS GPU instance
Install pyenv on EC2 (Amazon Linux)
Prepare your first Python development environment
Create a Linux environment on Windows 10
Python development environment construction on macOS
Create a python environment on centos
Stop your AWS instance using Boto3
Install Python development environment on Windows 10
Introduce Python 3.5.2 environment on Amazon Linux
Procedure for building a kube environment on amazon linux2 (aws) ~ (with bonus)
Create a Python development environment on Windows (Visual Studio Code remote WSL).
June 2017 version to build Tensorflow / Keras environment on GPU instance of AWS
# 1 Until you deploy Django's web application (instance construction with EC2 on AWS)
Until you publish your Django application (+ MySQL) on AWS EC2 (+ RDS (+ S3))
Install Python3 and Django on Amazon Linux (EC2) and run your web server