Skip to content

How to install the latest cid-cmd (Cloud Intelligence Dashboards CLI) in AWS CloudShell

4 minute read
Content level: Advanced
0

Learn how to upgrade Python in AWS CloudShell so you can install and run the latest cid-cmd CLI for deploying Cloud Intelligence Dashboards. This step-by-step guide uses pyenv to build Python 3.12 in CloudShell's persistent storage — no EC2 instance or local setup required.

Problem

AWS CloudShell currently ships with Python 3.9. The latest version of cid-cmd — the CLI tool for deploying and managing AWS Cloud Intelligence Dashboards — requires Python 3.10+. Running pip install cid-cmd in CloudShell will not install the latest version. Only the latest version supported on Python 3.9 is installed. Meaning you do not have access to the latest updates, fixes and features of the cid-cmd tool.

Solution

You can use pyenv to install a newer Python version in CloudShell's persistent home directory (~1 GB). The compiled Python survives session restarts, so you only need to do this once. If you change regions where you use CloudShell, you will need to perform these steps in each region. CloudShell does not share configuration across regions. You can use this solution for any tool where you want require a newer version of Python then what CLoudShell has. This provides for a minimal installation to take into account what space you have available in a CloudShell environment.

Step 1: Install build dependencies

These are installed to the system filesystem (not your home directory) and are needed only for the initial compile. They are lost when the session ends but are not needed after Python is built.

sudo yum install -y gcc make zlib-devel bzip2-devel readline-devel \
  sqlite-devel openssl-devel libffi-devel xz-devel

Step 2: Install pyenv and configure your shell

curl https://pyenv.run | bash

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc

Step 3: Build and install Python 3.12

We skip ensurepip during the build to conserve disk space, then install pip separately.

PYTHON_CONFIGURE_OPTS="--without-ensurepip" pyenv install 3.12
pyenv global 3.12

Step 4: Verify the build

Confirm that SSL and zlib compiled correctly — both are required for pip and cid-cmd to work. Confirm you are using the version of Python you installed

python -c "import ssl; import zlib; print('ssl:', ssl.OPENSSL_VERSION); print('zlib: OK')"
python --version

You should see output like:

ssl: OpenSSL 1.1.1g FIPS  21 Apr 2020
zlib: OK

Step 5: Install pip and cid-cmd

wget -qO /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
python /tmp/get-pip.py
pip install cid-cmd

Step 6: Deploy your dashboards

cid-cmd deploy

What persists across sessions?

ComponentPersists?Location
pyenv + compiled Python✅ Yes~/.pyenv/ (home directory)
pip + installed packages✅ Yes~/.pyenv/versions/ (home directory)
.bashrc changes✅ Yes~/.bashrc (home directory)
yum install packages❌ NoSystem filesystem (ephemeral)

The yum install packages are only needed for the initial Python compile. Once Python is built, it runs independently. If you ever need to rebuild Python (e.g., upgrading to 3.13), you'll need to re-run the sudo yum install step in that session.

Troubleshooting

  • If you see no acceptable C compiler found, run sudo yum install -y gcc — the build dependencies from Step 1 were lost because your session restarted.
  • If you see No module named '_ssl', the OpenSSL headers were missing during the build. Install them and rebuild: sudo yum install -y openssl-devel then pyenv install 3.12 --force.
  • If you're running low on disk space, check usage with df -h ~ and du -sh ~/.* ~/* 2>/dev/null | sort -rh | head -20. You can reset CloudShell entirely via Actions → Delete AWS CloudShell home directory.
  • If openssl-devel is not found in yum, run yum list available | grep -i openssl | grep devel to find the correct package name for your CloudShell version.