Deploying Application Gateway with Terraform code

Greetings

I am deploying multiple resources in azure devops pipeline using the Terraform code. Everytime the pipeline is run the application gateway returns the following error. The code for the application gateway is hereby attached. Please waiting for recommendation.

Error: Error Creating/Updating Application Gateway “dbc-pi-appgateway-01” (Resource Group “rg-dbc-pi-shared-001”): network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 – Original Error: Code=“InvalidResourceReference” Message=“Resource /subscriptions/780f9206-52e1-4f07-afa5-8783e9e851c3/resourceGroups/rg-dbc-pi-shared-001/providers/Microsoft.Network/applicationGateways/dbc-pi-appgateway-01/trustedRootCertificates/test-cer-file referenced by resource /subscriptions/780f9206-52e1-4f07-afa5-8783e9e851c3/resourceGroups/rg-dbc-pi-shared-001/providers/Microsoft.Network/applicationGateways/dbc-pi-appgateway-01/backendHttpSettingsCollection/test was not found. Please make sure that the referenced resource exists, and that both resources are in the same region.” Details=