We are working on adding ARM support to Infracost....
# general
c
We are working on adding ARM support to Infracost. Using the ARM What-If API we just succeeded in getting an estimate for an Azure ASP + Web App. Next step is calling infracost breakdown with the actual IaC template rather than the What-If result. Many thanks to @prehistoric-article-73489 who did the bulk of the implementation work!
w
Hey Tiamo - that looks cool! I just read through this tutorial to understand ARM what-if better. Would I be right in saying that
az deployment group what-if
is similar to
terraform plan
- so it gives you a diff of resources, and by you passing that into
infracost breakdown
you kinda get a diff of what is about to be added?
p
That's exactly right Ali! It returns a snapshot of the resource properties before and after the submitted change, and also lists the direct property changes. We're still early on with getting all the test infrastructure in place, but it looks pretty promising so far 🙂
w
Very nice - thanks for sharing your knowledge and early work with the community!
p
Hey @white-airport-8778, to get a
whatif
from an arm template we need some additional info from the user (deployment scope, resource group name, location etc.) what would be the place to do that? Seems this could be in
Project
or
Config
. Both are pretty terraform specific so this would be a tack-on or separate objects for the azurerm provider. I'm leaning towards a separate
Project
for azurerm related providers. But that might be a lot of work. Thoughts?
w
@prehistoric-article-73489 ignoring infracost for a second, how do users input those things to ARM just now? Do they pass those in via files or flags or envs or all 3?
p
Flags to the az cli mostly, az also has different commands based on the scope (resource group, subscription etc.). Example: https://learn.microsoft.com/en-us/cli/azure/deployment/sub?view=azure-cli-latest#az-deployment-sub-what-if
w
ok if I move this chat to #contributors ? I’ll add some thoughts there and tag you in a min