This blog post is about my experience setting up Bodhi Linux (BL for short hereafter) for software development for AWS using Python and AWS CDK.
Items to setup
- Git
- Python
- AWS CLI
- npm (includes nodejs)
- AWS CDK
- Configure AWS
tldr;
All the commands for a new PC setup.
git config --global user.name "Zhixian"
git config --global user.email "zhixian@hotmail.com"
sudo apt install git-gui
sudo apt install gitk
sudo apt install python-is-python3
sudo apt install python3-venv
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
sudo apt install npm
npm install -g aws-cdk
aws configure
aws s3 ls
Git
BL comes pre-installed with git.
So I just have to configure it with my name (Zhixian) and my email (zhixian@hotmail.com).
git config --global user.name "Zhixian"
git config --global user.email "zhixian@hotmail.com"
However, only the git command-line interface (CLI) tools are installed. The other commonly see graphical user interface (GUI) tools ‘git-gui’ and ‘gitk’ are not installed. Since I do use those those tools, I installed them via the following ‘apt’ command:
sudo apt install git-gui
sudo apt install gitk
Aside: Actually, the command sudo apt install git-gui
is sufficient.
It would installs ‘gitk’. One of the nice side effects of installing these GUI tools is that it would also install ‘tcl’ language interpreter and the ‘tk’ graphical toolkit library that ‘tcl’ needs to create user interfaces.
Python
BL does installed with Python3. However, we commonly invoke the Python using the command ‘python’. To install the package that maps ‘python3’ to ‘python’, run the following apt commands:
sudo apt install python-is-python3
For Python development, it is common to use a virtual environment via the ‘venv’ module. However, the module installed in BL is missing another module call ‘ensurepip’. So get ‘venv’ working we need to install the ‘python-venv’ module using the following command:
sudo apt install python3-venv
AWS CLI
To install the latest version of AWS CLI tools, run the following commands:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
npm (includes nodejs)
Installing the node package manager (npm) will also install the Nodejs interpreter.
Strictly speaking, this is not needed if you are not going to use AWS CDK.
Having said that, it is fairly common to see tools installed written in Nodejs and installed via npm (just like AWS CDK). So its probably a good idea to install it.
npm can be installed via the following command:
sudo apt install npm
AWS CDK
The AWS CDK is installed using npm command.
So you need to execute the previous step.
To install the AWS CDK, run the following command:
sudo npm install -g aws-cdk
Configure AWS
The last step is to run the configure AWS. I’m assuming you have the AWS Access ID and AWS Secret Access Key.
To configure, run the following command:
aws configure
And then finally to see if your AWS CLI is working:
aws s3 ls
If you reach this step, you would be good to go to develop stuff for AWS using Python.
Leave a comment