The command i used is as follows:-
aws ec2 run-instances --image-id *ubuntu image id* --count 1 --instance-type t2.micro --key-name new_instance --security-group-ids mysecuity --user-data file://aws.txt
The Aws.txt contained the following things:-
`#!/bin/bash sudo apt-get update sudo apt-get install -y apache2 php7.0 php7.0-curl php7.0-cli sudo service apache2 start sudo apt-get install -y python3 python-pip sudo apt-get update && sudo pip install --upgrade --user awscli mkdir ~/.aws && cd ~/.aws touch credentials && touch config echo "[default]" > credentials echo "aws_access_key_id = *id here*" >> credentials echo "aws_secret_access_key = *secret key*" >> credentials echo "[default]" > config echo "output = json" >> config echo "region = ap-south-1" >> config`enter code here` sudo aws s3 sync s3://*bucket name* var/www/html`
But only Apache and PHP are getting installed, and mkdir is also not working. Can someone please analyse the snippet and let me know as what is the mistake?