DWQA QuestionsHow can I execute user data to automatically create a file with every restart of my Amazon EC2 instance?
kandy asked 3 years ago

Solution :
#!/bin/bash
sudo apt-get update -y
sudo apt-get install curl -y
sudo apt-get install zip -y
sudo apt-get install apache2 -y
sudo apt install php7.2-cli -y
sudo apt install hhvm
sudo service apache2 restart
sudo apt-get install awscli -y
sudo aws s3 sync  s3://bucketName storage_path