Extremely slow execution of an external dependency function

no no… if you need to upload from the browser uses temp keys that are generated for that user only. i think aws has something called a STS KEY, you first define which path and what the keys can do dynamically, then pass the keys to the browser, and allow the browser to upload… the keys live for a short time say 60 mins.