Member-only story
🔥Let’s Do DevOps: Make Tofu/Terraform More Failure Tolerant with AzApi Provider!🚀
This blog series focuses on presenting complex DevOps projects as simple and approachable via plain language and lots of pictures. You can do it!
Hey all!
This article follows one where I go over what the AzAPI Tofu (also Terraform!) Provider is, and how you can use it to find all sorts of info about Azure, including all the subnets across an entire subscription. That’s pretty awesome, go read it if you haven’t.
This article builds on that topic, and shares a technique I created for a work project — to find the primary private IP of a bunch of hosts that might change rapidly over time — for instance, a pool of application hosts that might grow over time. That list of private IPs can be fed to an Application Gateway or a FrontDoor resource, and traffic can be routed to them — but not if Tofu can’t find them!
This particular project had an additional complication — the Resource Groups that we were looking in for the VMs sometimes don’t exist. Think you’re deploying a new environment, and you deploy the AppGw before you deploy the other Tofu layer that deploys the servers.
Even with the cool AzApi tools we talked about last article, this would error out, with an error that the RG doesn’t exist. That’s…
