Hello,
We run terraform format, validate, plan and apply as part of CI/CD using github actions workflow to create DNS, LB in Cloudflare. As a part of creating a new DNS record, we have created a pull request in GIT which runs the terraform plan. We have observed a new set of objects/logs in plan as following.
Terraform detected the following changes made outside of Terraform since the
last "terraform apply":
# cloudflare_record.x_y_z has changed
~ resource "cloudflare_record" "x_y_z" {
id = "xxxxxxxxxxxxxxxxxxx"
~ metadata = {
- "source" = "primary" -> null
# (3 unchanged elements hidden)
}
name = "xxxxxxxxxxxx"
# (11 unchanged attributes hidden)
}
But the record with it’s ID is in refreshing state but losing the original state of metadata. We have seen the same for all the records present in Github repo (previous deployments).
Is there any work around to retrieve the metadata to original state (last state file) ?
Thanks in advance.