参考
docs.aws.amazon.com
手元のPC
インストールディレクトリ設定ファイル作成
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>choiceAttribute</key>
<string>customLocation</string>
<key>attributeSetting</key>
<string>/Users/`id -un`</string>
<key>choiceIdentifier</key>
<string>default</string>
</dict>
</array>
</plist>
" | tee ~/choices.xml
pkgのダウンロード
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
pkgのインストール
installer -pkg AWSCLIV2.pkg \
-target CurrentUserHomeDirectory \
-applyChoiceChangesXML choices.xml
INSTALL_dir=$(cat ~/choices.xml | grep "string>/" | awk -F'[<>]' '{print $3}')
sudo ln -s ${INSTALL_dir}/aws-cli/aws /usr/local/bin/aws
sudo ln -s ${INSTALL_dir}/aws-cli/aws_completer /usr/local/bin/aws_completer
コマンドパス確認
- 必要に応じて環境変数を再読み込み (
source ~/.zshrc
)
which aws