-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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 record fails to apply when instance is stopped / shutdown #6770
Comments
I had the same issue, instance was not getting public ip as I have not requested.
|
You're right, and this is the case is my setup. |
Confirmed here also. |
I am not sure this is a terraform bug. Terraform is reacting to the fact that the IP address has changed. Why would you expect terraform to keep the IP address the same? When the instance comes back up, it will have a different IP and Terraform would need to change it then anyway Paul |
Well, the fact is, that Terraform is failing to update the DNS, which is quite normal, as the host is down. |
I am also experiencing this problem. I definitely feel this is a bug. Terraform should not ever try to set route53 records to blank values, and just assume the record should be destroyed. It can be argued that a stopped instance is probably in some transient state so removing the record might not be in my best interest, however, I would rather have that behavior at the very minimum over a complete failure of the run. |
This issue reared its head in v0.8.2 as a result of this bug #10908 in case others experience a similar error. |
Is this issue going to get any visibility any time soon? We are up to 0.9.7 and still seeing this. I would expect that the route53 resource really should never attempt setting a blank value on an A record??? Thanks! :) @stack72 I disagree with the comment above that this isn't a Terraform bug. The whole purpose of terraform's early plan operation is to detect this kind of problems before the apply stage is even executed. Terraform should know better than it can't set a blank IPv4 entry and do one of two things: 1.) Error during plan, which would require us to use some kind of hack to ensure a stopped instance doesn't try to set blank variables. I would think any time terraform comes back with a "surprise" from the API that it did something that should not have occurred, it tells me that there is improvement that could be made in terraform's plan stage so that it can't even end up in that state. Wouldn't allowing this error, regardless of who caused the bad input, continue to come back from the API instead of detection during plan go against the entire concept of terraform? I think there needs to be a smarter solution here. @bmalynovytch and I can't be the only ones setting Route53 A records based off of the public_ip of an ec2_instance resource... |
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. |
Dear all,
I'm facing a recurrent issue.
When 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:Terraform Version
Affected Resource(s)
Expected Behavior
Do not apply a new value if it does not match the validation pattern.
Actual Behavior
Request fails, trying to apply an invalid (empty) value.
Steps to Reproduce
aws_instance
aws_route53_record
of typeA
, using the previously created instance's gathered IP address (aws_instance.myhost.public_ip
)terraform apply
terraform apply
References
This issue is related to comment #1579 (comment)
The text was updated successfully, but these errors were encountered: