Score:0

AWS CLI usage from Google Cloud Shell

br flag

I installed AWS CLI on GCP Cloud shell as per instructions for Linux:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

This works as expected but when returning after an overnight break I get the error:

-bash: aws: command not found 

The AWS folder is still in my home directory:

ls ~/aws
dist  install  README.md  THIRD_PARTY_LICENSES

How do I maintain access without re-installing?

Update:

My understanding is the core VM is ephemeral for cloud shell but the home directory is saved between sessions.

Looks like I need to modify the installer to install in my home directory. This is the default installer script.

sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update

How do I modify this script to install in the correct directories in my home directory?

jabbson avatar
sb flag
Which image did you use on GCP?
jabbson avatar
sb flag
By default the installer installs the aws cli to `/usr/local/aws-cli` and then makes the symlinks to `/usr/local/bin`. If after installing the aws cli you cannot use `aws` binary then the `/usr/local/bin` must be not in PATH or installed binaries were purged from the `/usr/local/bin`.
nipy avatar
br flag
My understanding is the core VM is ephemeral for cloud shell but the home directory is saved between sessions.
nipy avatar
br flag
I guess I need to modify the installer to install in my home directory. This is the default installer script. `sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.