Especially for computational stuff, like Math, when using its "Advanced Data Analysis" feature where it doesn't try to hallucinate the answer but generates the code to compute the answer instead.
My knowledge of Terraform was limited to the basic principles, but I've been using ChatGPT to develop scripts and learn as I go. It's been excellent, and the scripts I've been working on are merrily terraforming AWS with a custom VPC, subnets, internet gateway, security groups, EC2 instances, keypair generation, etc.
The majority of suggestions work first time. The ones that don't are a good learning experience, as you can discuss the issue or error with GPT4 and dig deeper into the causes. For an effective learning experience, it's important to not just accept config or code that you don't understand. This is where the nature of ChatGPT is useful, because you can ask as many followup questions as you like. When learning this way, it's also useful to tweak the custom instructions feature and focus the responses on common or idiomatic approaches.
I'm not sure if your comment was more about asking it to generate a complete Terraform project and verifying that everything runs perfectly first time, but I wanted to mention that it's been highly accurate for me when taking an iterative approach (GPT4 at least).
I think anyone who treats LLMs like search engines is setting themselves up for disappointment.