Add IP address to existing A record


I can insert a A record via Terraform, but next to this, I do need to add an IP address to an other already existing A record. How can I achieve this without knowing what already is in this A record ?


If you are meaning that you want to adjust the list of IP addresses for an existing A record then you’d need to ask Terraform to manage the record before it can start making changes.

The normal way would be to use terraform import but you’d need to also write code to handle whatever other IP addresses you also want in the list.


Thanks for your reply. Do you have (I hope) an example how to achieve this (with or without the coding part)?

The Terraform Learn guides have a short tutorial explaining how to use terraform import. Its example is a docker_container resource, but hopefully it’s a good analogy for your DNS use case!

Thanks! Will look into that