Lets say I have a resource group, and a storage ac...
# azure
f
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
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
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,
...)