1.目的
aws cliがすでにインストール済の環境に対して、aws cliを最新版へとアップロードして、初期設定(aws configure)を実施する。
2.設定方法
pythonがインストールされていることの確認。
python --version
Python 2.7.16
pip(Pythonのパッケージを管理ツール)をインストール。
curl -O https://bootstrap.pypa.io/get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1734k 100 1734k 0 0 21.7M 0 --:--:-- --:--:-- --:--:-- 21.7M
pipコマンドの準備を行う。
python get-pip.py --user
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
|████████████████████████████████| 1.4MB 4.3MB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: pip, wheel
WARNING: The scripts pip, pip2 and pip2.7 are installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script wheel is installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
諸々、pipコマンドの事前準備を行う。
echo export PATH='~/.local/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
pip --version
pipコマンドを用いて、awscliをアップグレード。
pip install awscli --upgrade --user
aws configureコマンドを用いて、初期設定を行う。
#AWS Access Key IDとAWS Secret Access Keyは仮値です。
利用するアプリケーションの環境に合わせて設定する必要があります。
aws configure
AWS Access Key ID [None]: AKIAS3RLIIKFLYZ67XNT
AWS Secret Access Key [None]: XXXXXXXXXXXXXXXX
Default region name [None]: ap-northeast-1
Default output format [None]: json
以上