79648484

Date: 2025-06-02 09:37:21
Score: 0.5
Natty:
Report link

Using nslookup to dynamically resolve IPs and inject them into Terraform-managed security groups is not recommended.

Pod or workload IPs are ephemeral: In Kubernetes or cloud environments, IPs often change due to scaling, rescheduling, or restarts. Any DNS-based IP resolution will likely become outdated quickly. And Terraform is declarative, not dynamic: It’s designed for infrastructure as code, not for reacting to real-time data like changing DNS records. This approach introduces state drift and breaks the idempotency of Terraform.

You should look at the following solutions:

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: aboubobo