added function to create a instance with user data(to run custom scripts on instance launch)