-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
AWS Route53 - Diffs didn't match during apply #1404
Comments
Thanks for reporting this @lyptt . Unfortunately I'm not able to reproduce this on either Terraform 0.4.0 that I just downloaded, or from the build of the current
I'm attempting another test with an AWS Instance and using it's private IP. Do you have any other information to help me reproduce this? Thanks! |
I modified the config to use the private IP of an instance and still can't reproduce the issue:
|
It looks like this is an issue when working with a tfstate file created in 0.3.7. Using tfstate files only created in 0.4.0 won't reproduce the issue. This issue is prevalent in 0.3.7 and it appears that this issue then follows onto 0.4.0 via the tfstate file. |
@catsby Another thing that seems to reproduce the issue, but I'm unsure how it's related, is when the target AMIs of the instances using these Route 53 records changes. I get exactly the same error when swapping out an old AMI with a new AMI. We're having to work around this by running destroy, then pulling down the latest terraform config files and running apply on a blank slate, basically avoiding tfstate files entirely, which isn't ideal. |
@catsby I've gotten down a decent way of reproducing this one. Based on the following config file:
Run an initial
It seems that once an instance is destroyed, the Route 53 record is no longer able to be tracked, causing this bug. I've tried merging in a fix for a similar issue #1430 into 0.4.0 (on the commit tagged 0.4.0), and this doesn't appear to fix the issue unfortunately. Any ideas? |
Odd, I suspected #1430 to fix this; I can't reproduce on master :/ I used this config: provider "aws" {
region = "us-west-2"
}
resource "aws_route53_zone" "myapp" {
name = "myapp.example.local"
}
resource "aws_instance" "nat" {
ami = "ami-21f78e11"
instance_type = "t1.micro"
tags {
Name = "testing-vpc-subnet-things"
}
}
resource "aws_route53_record" "gateway" {
zone_id = "${aws_route53_zone.myapp.zone_id}"
name = "gateway.myapp.example.local"
type = "A"
ttl = "300"
records = ["${aws_instance.nat.private_ip}"]
} And changed it to this: provider "aws" {
region = "us-west-2"
}
resource "aws_route53_zone" "myapp" {
name = "myapp.example.local"
}
resource "aws_instance" "nat" {
ami = "ami-dfc39aef"
instance_type = "t2.micro"
tags {
Name = "testing-vpc-subnet-things"
}
}
resource "aws_route53_record" "gateway" {
zone_id = "${aws_route53_zone.myapp.zone_id}"
name = "gateway.myapp.example.local"
type = "A"
ttl = "300"
records = ["${aws_instance.nat.private_ip}"]
} The relevant plan bits:
Everything worked as expected, the Route received the new record:
Can you check out the |
This appears to be fixed in 0.4.2, thanks! |
Great to hear, thanks for opening the issue! |
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
On 0.4.0 and lower, when running terraform apply with Route 53 configurations we get the message 'diffs didn't match during apply'.
Here's the contents of the Route 53 config tf file:
We were hoping this would be fixed by 0.4.0, but that does not appear to be the case as it's still happening on the latest release.
The text was updated successfully, but these errors were encountered: