Terraform: ignore_changes conditionally? (temporary EC2 instance public IP address)
Maybe you could use "count" attribute for this?

resource "cloudflare_record" "record1" {
    count = ${aws_instance.instance1.public_ip == "" ? 0 : 1}"
    ...
}