Use Google Cloud DNS to map a domain name to the Cloud Function URL. -> Correct. By using Google Cloud DNS, you can map a domain name to the Cloud Function URL. This way, your application can use the domain name instead of the hardcoded URL, making it easier to manage if the URL of the Cloud Function changes.
Use Google Cloud Endpoints to maintain the list of Cloud Function URLs. -> Incorrect. Google Cloud Endpoints is a distributed API management system, and it's not typically used for managing Cloud Function URLs.
Use Cloud Pub/Sub to trigger the Cloud Function. -> Incorrect. While Cloud Pub/Sub can be used to trigger a Cloud Function, it doesn't solve the issue of avoiding hardcoded URLs in the Compute Engine application.
Use Cloud Tasks to schedule the Cloud Function calls. -> Incorrect. Cloud Tasks is a task queue service for asynchronous task execution, and it's not intended to be used as a service discovery mechanism.