Skip to content
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 Route 53 Records delete every apply #1264

Closed
wazoo opened this issue Mar 20, 2015 · 7 comments
Closed

AWS Route 53 Records delete every apply #1264

wazoo opened this issue Mar 20, 2015 · 7 comments

Comments

@wazoo
Copy link

wazoo commented Mar 20, 2015

For some reason every time I run terraform apply it deletes all of the DNS records in the config and re-applies them, this creates a lot of blocking tasks.

My records aren't anything complicated, here is an example:

resource "aws_route53_record" "app_stage" {
   zone_id = "${var.aws_hosed_zones.testing_internal}"
   name = "app-stg"
   type = "CNAME"
   ttl = "120"
   records = ["${aws_elb.lb_app.dns_name}"]
}

And this gives me (sanitized):

-/+ aws_route53_record.app_stage
    name:              "app_stage.domain.com" => "app_stage" (forces new resource)
    records.#:         "1" => "1"
    records.12345678: "app_stage-123456789.us-west-2.elb.amazonaws.com" => "app_stage-123456789.us-west-2.elb.amazonaws.com"
    ttl:               "120" => "120"
    type:              "CNAME" => "CNAME"
    zone_id:           "<zone>" => "<zone>"

Is this expected behavior?

@catsby
Copy link
Contributor

catsby commented Mar 20, 2015

Hey @wazoo – if you're not changing anything, then no this is not expected. Is this on 0.3.7?

@wazoo
Copy link
Author

wazoo commented Mar 20, 2015

Yep.

$ terraform -v
Terraform v0.3.7

I don't know if it matters but the zone is an "internal" zone that is attached to a VPC and it is not managed by terraform (because I can't do private zones with TF right now).

@radeksimko
Copy link
Member

@catsby This is really happening (even with latest 0.4.0-dev version) if you use the "auto-magic" feature from #969
See #1122

It is possible to work around that, taking the example above:

resource "aws_route53_record" "app_stage" {
   zone_id = "${var.aws_hosed_zones.testing_internal}"
   name = "app-stg.domain.com" # Notice the `.domain.com` here
   type = "CNAME"
   ttl = "120"
   records = ["${aws_elb.lb_app.dns_name}"]
}

@catsby
Copy link
Contributor

catsby commented Mar 23, 2015

Thanks @wazoo and @radeksimko ; #969 was well intended and a good idea I think, but so far it seems to be introducing more problems than the convenience is worth. I'm going to tinker with something this morning and discuss internally.

@wazoo
Copy link
Author

wazoo commented Mar 23, 2015

Interesting, I see where you were going with 969, makes sense. I guess my issue here was that I can't manage the zone with TF yet (its internal only). I will use the FQDN for now, thats a pretty easy workaround.

@catsby
Copy link
Contributor

catsby commented Mar 30, 2015

The core issue here is fixed with #1279. Route 53 records still need a proper update function, as detailed in #1122

@ghost
Copy link

ghost commented May 3, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants