It turns out the region was not set correctly, I corrected the region and it worked. It would be great if aws can give more relevant error message.