https://pulumi.com logo
#azure
Title
# azure
f

full-lamp-64265

12/20/2023, 2:45 PM
Lets say I have a resource group, and a storage account inside it, and a blob container inside the storage account, would it be sensible to make the resource group the parent of the storage account, and the storage account the parent of the blob container? And is there some shorthand way to do this easily or do I just use
opts=pulumi.ResourceOptions(parent=...)
every time?
l

little-library-54601

12/22/2023, 2:08 PM
I have Pulumi code that creates all 3, and I don't explicitly set anything as "parent." The fact that the storage account depends on the resource group and the blob container on the storage account is sufficient to achieve the required dependencies, at least for me.
b

bumpy-glass-30283

01/04/2024, 12:57 PM
if you use the object properties, pulumi will automatically resolve the dependency order, though it will not set parent-child relationship afaik. Example:
Copy code
...
rg = resources.ResourceGroup(
        resource_name="something",
    )
sa = storage.StorageAccount(
...
resource_group_name=rg.name,
...)