DEV Community

Discussion on: Infrastructure as code in 2021

Collapse
 
skovvart profile image
Nicolai Skovvart • Edited

Caveat: Everything below is with an Azure only perspective:

I think the best option is honestly the az cli which is judged fairly hardly here.
Unlike az powershell, most (all?) operations are idempodent, it's the most succinct and easiest to read of all the options and it includes the ability to deploy raw ARM as an escape hatch when necessary (and in my experience, it's always necessary at some point...).
Together with powershell for programmability, there's not very much missing beyond what-if and destruction features (partially mitigated by the increased readability and sensible use of resource groups that can be deleted...)

Collapse
 
crgarcia12 profile image
Carlos Garcia Lalicata

CLI is not idempotent at all, and it is also much harder to have a history of what was run, and how to replicate the environment. I agree that PS (cli in your case) are much easier to write down when you have no clue what you are doing - and I usually have no clue what I am doing until I am done

Collapse
 
skovvart profile image
Nicolai Skovvart

Well, it is idempotent - creating a resource twice in a row will not fail on the second call because the resource exists, or result in different state than the first call. That's idempotence. Maybe you've run into exceptions to this, but it's definitely not the rule.

I also do not appreciate the "when you have no clue what you doing" phrasing. I am literate in ARM (...and Bicep and Farmer and...), and still prefer the AZ CLI , even for "production" IAC.

Thread Thread
 
crgarcia12 profile image
Carlos Garcia Lalicata • Edited

I apologize Nicolai, my phrasing is a really bad translation-mistake. That sentence construct using the plural "you" is very common in my native language, and is used to generalize. What I meant is that when I am using PS/CLI, I can do much more with autocomplete without having to google everything. With ARM/TF/Bicep I end up googling every single line, because it is not that intuitive where I should write what without looking into an schema. Sorry for the phrasing, I had no intentions to talk about you or your specific work/knowledge. Specially because I (unfortunately) do not know you

Thread Thread
 
skovvart profile image
Nicolai Skovvart

No worries - communication can be hard for both parties, particularly on the internet. Have a good day :)

Collapse
 
unosd profile image
Stefano d'Antonio • Edited

Thank you for the feedback. Ultimately it is down to your requirements, Azure CLI may be the best option in your case, but you also mentioned the weak points: it is not cloud-agnostic, does not support plan (what/if) and clean up of resources (and tracking of changes when a parameter is not specified), which can be critical features for some projects. Also it is imperative and it requires more code (that can get ugly in Bash) if you want to parallelize and handle dependencies or errors. To your point I agree that is quite succinct, but I would not recommend it in most of the cases.