{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6770","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6770/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6770/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6770/events","html_url":"https://github.com/hashicorp/terraform/issues/6770","id":155770319,"number":6770,"title":"AWS Route53 record fails to apply when instance is stopped / shutdown","user":{"login":"bmalynovytch","id":7847492,"avatar_url":"https://avatars.githubusercontent.com/u/7847492?v=3","gravatar_id":"","url":"https://api.github.com/users/bmalynovytch","html_url":"https://github.com/bmalynovytch","followers_url":"https://api.github.com/users/bmalynovytch/followers","following_url":"https://api.github.com/users/bmalynovytch/following{/other_user}","gists_url":"https://api.github.com/users/bmalynovytch/gists{/gist_id}","starred_url":"https://api.github.com/users/bmalynovytch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmalynovytch/subscriptions","organizations_url":"https://api.github.com/users/bmalynovytch/orgs","repos_url":"https://api.github.com/users/bmalynovytch/repos","events_url":"https://api.github.com/users/bmalynovytch/events{/privacy}","received_events_url":"https://api.github.com/users/bmalynovytch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/waiting-response","name":"waiting-response","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-05-19T15:46:22Z","updated_at":"2016-08-10T07:32:22Z","closed_at":null,"body":"Dear all,\r\n\r\nI'm facing a recurrent issue.\r\nWhen applying configuration with some AWS instances that are shutdown / stopped, with Route53 records attached, Terraform tries to apply a new (empty) value to the `aws_route53_record` which fails:\r\n```\r\n~ aws_route53_record.myhost\r\n    records.0:         \"\" => \"\"\r\n    records.200629859: \"1.2.3.4\" => \"\"\r\n```\r\n```\r\n* aws_route53_record.myhost: InvalidChangeBatch: Invalid Resource Record: FATAL problem: ARRDATAIllegalIPv4Address (Value is not a valid IPv4 address) encountered with ''\r\n\tstatus code: 400, request id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx\r\n```\r\n\r\n### Terraform Version\r\n```\r\n$ terraform -v\r\nTerraform v0.6.16\r\n```\r\n### Affected Resource(s)\r\n- aws_route53_record\r\n\r\n### Expected Behavior\r\nDo not apply a new value if it does not match the validation pattern.\r\n\r\n### Actual Behavior\r\nRequest fails, trying to apply an invalid (empty) value.\r\n\r\n### Steps to Reproduce\r\n1. define a resource of type `aws_instance`\r\n1. define a resource of type `aws_route53_record` of type `A`, using the previously created instance's gathered IP address (`aws_instance.myhost.public_ip`)\r\n1. `terraform apply`\r\n1. Instance is created, DNS record is created with the corresponding IP address\r\n1. Stop the instance using AWS Console\r\n1. `terraform apply`\r\n1. Apply fails, trying to change/update the attached IP address\r\n\r\n### References\r\nThis issue is related to comment https://github.com/hashicorp/terraform/issues/1579#issuecomment-175475155"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/238788111","html_url":"https://github.com/hashicorp/terraform/issues/6770#issuecomment-238788111","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/6770","id":238788111,"user":{"login":"bmalynovytch","id":7847492,"avatar_url":"https://avatars.githubusercontent.com/u/7847492?v=3","gravatar_id":"","url":"https://api.github.com/users/bmalynovytch","html_url":"https://github.com/bmalynovytch","followers_url":"https://api.github.com/users/bmalynovytch/followers","following_url":"https://api.github.com/users/bmalynovytch/following{/other_user}","gists_url":"https://api.github.com/users/bmalynovytch/gists{/gist_id}","starred_url":"https://api.github.com/users/bmalynovytch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmalynovytch/subscriptions","organizations_url":"https://api.github.com/users/bmalynovytch/orgs","repos_url":"https://api.github.com/users/bmalynovytch/repos","events_url":"https://api.github.com/users/bmalynovytch/events{/privacy}","received_events_url":"https://api.github.com/users/bmalynovytch/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T07:32:22Z","updated_at":"2016-08-10T07:32:22Z","body":"Well, the fact is, that Terraform is failing to update the DNS, which is quite normal, as the host is down.\r\nWhy ignoring the DNS update ? Because, \"empty\" isn't a valid value, and that updating a DNS entry for a down host is useless.\r\nIf you could suggest something better for this specific case (updating a resource to an invalid value, due to a dependency state), I'm fine, but the failure isn't acceptable, as I use TF with a team, with a locking system that doesn't release the lock if a failure occurred."}}
{"actor":{"display_login":"bmalynovytch"}}