-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when overwriting google_dns_record_set #9112
Error when overwriting google_dns_record_set #9112
Comments
@rbianchi29 can you try v3.67.0? Please share the debug log if that does not work |
I just tried but I cannot download that provider version. I don't think it's been released just yet? |
@rbianchi29 the release should be out now. Can you verify? |
@rbianchi29 is this still an issue? |
Apologies for the delayed response. I've just tested with 3.67.0 and it's still an issue am afraid. |
@rbianchi29 can you post your config and the steps to repro, and the debug log? |
Sure. Below are the two config files. I run an apply on Config File 1 first to deploy the DNS record, which runs successfully. I then run an apply on Config File 2 which fails because the DNS record already exists. It used to overwrite the record. Terraform State is kept separate for both deployments. I can get a debug log for you tomorrow. Config File 1 resource "google_dns_record_set" "test-dns" { managed_zone = "testing-ryan-com" Config File 2 resource "google_dns_record_set" "test-dns" { managed_zone = "testing-ryan-com" |
@rbianchi29 yes, waiting for the debug logs of both runs |
Second Run - This is the attempt to overwrite the DNS record 2021/05/18 16:24:15 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
|
First Run - This is the initial DNS record creation 2021/05/19 09:48:15 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
|
@rbianchi29 this is 409 error from api which indicates alreadyExists I noticed below plan in your second run which says will be created. Do you see
Also can you see if there is any reason listed below that might fit your case? Do you have other resources that are included in the plan? |
No the plan states it will be created, not replaced. That link looks like it's more for the Google Workspace console rather than GCP. If it helps this issue doesn't occur with 3.63.0 of the provider. Any version after that and I get this issue. |
@rbianchi29 are you running on different env (not shared state) for these two executions? |
That's right, different state. |
Note: the solution to #9257 is almost certainly the solution to this |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
0.14.4
Affected Resource(s)
Terraform Configuration Files
resource "google_dns_record_set" "test-dns" {
project = "ryanb-mocb-dev"
name = "hello.testing.ryan.com."
type = "A"
ttl = 600
managed_zone = "testing-ryan-com"
rrdatas = ["10.10.10.2"]
}
Expected Behavior
We use Terraform to deploy our main environment and our disaster recovery environment. The disaster recovery environment is a replica of the main environment but deployed into a different region. The main environment includes Cloud DNS with DNS records for various VM instances. The disaster recovery environment is only deployed in the event of a region failure.
To deploy our disaster recovery environment we simply copy all of the Terraform code and change the region. When deploying the resources the DNS records that will currently point to resources in the main environment are overwritten and updated with the new IP addresses of the resources deployed into the new region for DR.
Actual Behavior
Since 3.64.0 onwards the DNS record creation will now fail with:
Error: Error creating ResourceDnsRecordSet: googleapi: Error 409: The resource 'entity.rrset' named 'hello.testing.ryan.com. (A)' already exists, alreadyExists
When using version 3.63.0 this issue doesn't occur, it simply overwrites the existing DNS record.
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: