In the console.aws.amazon.com, while launching the EC2 instance, we can specify user data to configure an instance or run a configuration script(installing PHP, Mysql, Apache, etc...) during launch in the UserData section in the Step 3: Configure Instance Details.