https://pulumi.com logo
Title
m

miniature-gigabyte-99238

03/28/2023, 8:17 AM
Hi everyone. I’m fairly new to Pulumi and Python. Have done some simple examples etc. Now I’m doing my first bigger setup, at least bigger then the tutorial on how to create a simple Azure object. When I do google searches etc I came up with the following in Python for an Azure VM:
<https://pastebin.com/MFzmv47L>
Now it complains about multiple parts. So for example the os_profile part should be
os_profile=azure_native.compute.OSProfileArgs(
        admin_password="{your-password}",
        admin_username="{your-username}",
        computer_name="myVM",
    ),
so I should use the xyzArgs function. I can do that but why are so many examples not using the Args but the way I use it in the pastebin? Is there two ways of doing it? One prefered about the other? Or is the non Args way for for the old Azure Provider and Args for the azure native one? Just trying to understand why.
b

billowy-army-68599

03/28/2023, 1:35 PM
@miniature-gigabyte-99238 you’re absolutely okay to handle it in the way you’re doing it in pastebin. Our Python SDK supports two input mechanisms: a standard dictionary of options (your pastebin way) a typed input (the
xyzArgs
way) This is really an artifact of how the python type system works. This is a good intro: https://cerfacs.fr/coop/python-typing I personally prefer the typed input way, but it can be quite verbose, however it really does help you catch errors when defining infrastructure
m

miniature-gigabyte-99238

04/01/2023, 9:44 AM
Thanks @billowy-army-68599 for clearing some things up. Helped a lot.