-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Can't create CNAME Route53 entry for an instance with Elastic IP in one pass #3474
Comments
What I do is generate the cname record value based on the eip public_ip, like:
But I agree this situation with EIPs is awkward. You can tell terraform that the route53 record depends on the eip resource, but I don't think there's a way to tell terraform that it additionally needs to refresh the ec2 instance after fully updating the eip resource and before creating/updating the route53 record? |
FYI, Cloudformation colud like this.
|
I think I am seeing this issue but since I'm using 0.12.20 I'm not sure. It actually worked fine in 0.11 but I think because 0.12 is faster than 0.11 (???). I'm seeing the R53 on the EIP fail because the EIP isn't complete. THEN I looked at the (trimmed) output more closely and see this is out of order:
Works fine on 2nd run. I tried referring to both aws_eip.eip.public_ip and aws_instance.instance.public_ip with same results. |
I'm still seeing this with TF 0.14.2 and aws v3.20.0 I don't seem to have pasted my HCL here yet.
|
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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. |
Terraform Version
Terraform v0.11.3
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/stevenewey/34b9276483098be0c92f067f7dcaa71d
Expected Behavior
In a single pass, the route53 entry should be created for the instance EIP.
Actual Behavior
On the first pass, the apply fails:
On the second pass, the apply is able to complete.
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
The reason why we need to use the DNS name here to create a CNAME, and not the IP, is so we can use this DNS name internally and externally, and through the magic of AWS DNS, have the name resolve externally to the EIP, and internally to the private IP.
I believe we could work around it if GH-1149 was implemented (aws_eip should have a Public DNS attribute).
References
The text was updated successfully, but these errors were encountered: