Hi, I am new in aws cloud please some can help with this script.
UserData:
Fn::Base64: |
#!/bin/bash
sudo su
yum update -y
yum install httpd -y
service httpd start
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
&& \. "$NVM_DIR/nvm.sh" # This loads nvm
&& \. "$NVM_DIR/bash_completion"
. /.nvm/nvm.sh
nvm ls-remote
nvm install v12.7.0
nvm use v12.7.0
node -e "console.log('Running Node.js ' + process.version)"
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
aws s3 sync s3://reactsearch /var/www/
cd /var/www/
yarn install
yarn run build
Tags:
when I am running vai ssh one by one script then is working fine but when I am using user data script then it's not working. I think
. /.nvm/nvm.sh not working