Migrating terraform local to terraform cloud, custom_data causes VM to rebuild

I have terraform codes locally and I am migrating them to terraform cloud. I have some windows and linux VMs built using Terraform, with custom_data. Upon migrating to terraform cloud, the plan indicates that the VMs need to be dropped and re-created, because of Custom_data. But they have not changed. And I compared my local copy of state file and the state on terraform cloud. The custom_data is exactly the same. But still Terraform cloud’s plan will not recognize them as the same and insist on recreating the VM. is there a way to avoid that? Thanks