Check your database region. The function should be deployed in the same region of the database. This worked for me