I am using terraform to provision an EC2 instance and then create DNS records pointing to it. On AWS, Static ip addresses are recommended over public ip addresses so that changing ip addresses when restarting does not cause issues. But with terraform, DNS records will be updated with either the new public IP/ public DNS. So, in theory, I do not need elastic IP addresses.
Without eip, I am still able to SSH using the public IP address, and public DNS/ hostname provided by AWS. But, when pointing a DNS record (A, or CNAME) to the public IP address & public DNS, SSH times out. This happens even when the DNS records propagate (I checked with dig domain.com and a global DNS propagation checker). Looks like something is blocking access from non IP-address/ non aws public DNS hosts.
Has anyone had this issue with pointing DNS records directly to public IPs/ public DNSs?