Deploy Failure check using terraform

Hi Team.
i am using azure pipelines and creating resources on gcp using terraform. Though want to check on failure points.
Now suppose the cloud function was deployed but with errors. so is there any way in terraform which can help us and tell that resource is having issues…
I tried to use data source on cloud function and extracted the name but that runs fine… need to know a way which can tell that there is a deploy issue at cloud function.


below is how i tried to use datasources

it worked fine.

Please suggest how to retrieve this issue using terraform.