Advertisement
eazevedo

cloud_shell.sh

May 9th, 2023 (edited)
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | Software | 0 0
  1. sudo yum install yum-utils curl jq terraform git gcc zlib-devel bzip2 bzip2-devel readline readline-devel patch sqlite sqlite-devel openssl openssl-devel libffi-devel -y -q
  2. git clone https://github.com/yyuu/pyenv.git ~/.pyenv
  3. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
  4. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
  5. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  6. echo 'filetype indent off' >> ~/.vimrc
  7. source ~/.bash_profile
  8. pyenv install 3.7.0
  9. touch /tmp/credentials
  10. curl -H "Authorization: $AWS_CONTAINER_AUTHORIZATION_TOKEN" $AWS_CONTAINER_CREDENTIALS_FULL_URI 2>/dev/null > /tmp/credentials
  11. ACCESS_KEY=`cat /tmp/credentials| jq -r .AccessKeyId`
  12. SECRET_KEY=`cat /tmp/credentials| jq -r .SecretAccessKey`
  13. SESSION_TOKEN=`cat /tmp/credentials| jq -r .Token`
  14. ACCOUNTID=$(aws sts get-caller-identity --query "Account" --output text)
  15. clear
  16. echo -ne "\n##### This is a temporary credential for the accountID $ACCOUNTID. ##### \n\n AWS_ACCESS_KEY_ID=${ACCESS_KEY}\n AWS_SECRET_ACCESS_KEY=${SECRET_KEY}\n AWS_SESSION_TOKEN=${SESSION_TOKEN}\n\n"
Tags: cloudshell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement