Detail:"Resource \"testing_resource.for_child\" not found in root module.",
Summary:"Resource mapped to non-existent target",
Detail:"Could not migrate resource \"testing_resource.for_child\". Target resource \"testing_resource.for_child\" not found in component \"component.child\".",
// then we might have a mapping for the module it is in below.
ifresource.Module.IsRoot(){
vardiagstfdiags.Diagnostics
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Resource not found",fmt.Sprintf("Resource %q not found in mapping.",resource.Resource.String())))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Resource not found",fmt.Sprintf("Resource %q exists in state, but was not included in any provided mapping.",resource.Resource.String())))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Module not found",fmt.Sprintf("Module %q not found in mapping.",resource.Module[0].Name)))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Module not found",fmt.Sprintf("Module %q exists in state, but was not included in any provided mapping.",resource.Module[0].Name)))
returnnil,diags
}
}
// getOwningProvider returns the address of the provider configuration,
// as well as the provider instance, that was used to create the given resource instance.
Detail:fmt.Sprintf("Provider %s was needed by the resource %s but was not found in the stack configuration.",ref.ProviderLocalName,resource.AbsResourceInstance.Item.Resource.String()),
Detail:fmt.Sprintf("Provider %s was needed by the resource %s but was not found in the stack configuration.",ref.ProviderLocalName,resource.AbsResourceInstance.String()),
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Provider not found",fmt.Sprintf("Resource %q not found in root module.",resource.String())))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Resource mapped to non-existent target",fmt.Sprintf("Could not migrate resource %q. Target resource %q not found in component %q.",source,resource.InModule(module),component)))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Provider not found",fmt.Sprintf("Module %q not found in root module children.",module[0])))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Resource mapped to non-existent target",fmt.Sprintf("Could not migrate resource %q. Module %q not found in component %q.",source,module,component)))
returnaddrs.LocalProviderConfig{},diags
}
// the address points to a nested module, so we continue the search
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Provider not found",fmt.Sprintf("Module call %q not found in configuration.",module[0])))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Resource mapped to non-existent target",fmt.Sprintf("Could not migrate resource %q. Module %q not found in component %q.",source,module,component)))
// Let's check the provider within the child module configuration.
r:=next.Module.ResourceByAddr(resource)
ifr==nil{
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Provider not found",fmt.Sprintf("Resource %q not found in containing module.",resource.String())))
diags=diags.Append(tfdiags.Sourceless(tfdiags.Error,"Resource mapped to non-existent target",fmt.Sprintf("Could not migrate resource %q. Resource %q not found component %q.",source,resource.InModule(module),component)))