fix scripts so that they run properly under an IAM role