When an EC2 instance is launched, AWS allows us to pass the user data as mentioned in the AWS Documentation here. This can be a script which gets executed when the EC2 instance starts. The script can be used to install or upgrade the application. This is the recommended approach for a temporary fix testing. If a lot of EC2s have to be created with the new application, instead of using the user data approach, it’s always better to create a new AMI with the new application.