worxspace / PSPulumi

GNU General Public License v3.0
7 stars 1 forks source link

Add support for explicit dependsOn #2

Closed janegilring closed 2 years ago

janegilring commented 2 years ago

https://www.pulumi.com/docs/intro/concepts/resources/options/dependson/

rdbartram commented 2 years ago

resolved in #5 module version 0.0.2 and az modules 0.0.3

So we extended the base pulumi resource class to allow for pulumiresources and strings to be passed to DependsOn.

Feel free to go bananas with the syntax...we made it easy for you though...so just pass the object you create in the command and we'll build the references for you 😄

$location = 'switzerlandnorth'

 $resourceGroup = New-AzureNativeResourcesResourceGroup -pulumiid "MyResourceGroup" -resourceGroupName "MyResourceGroup" -location $location

$resourceGroup1 = New-AzureNativeResourcesResourceGroup -pulumiid "MyResourceGroup1" -resourceGroupName "MyResourceGroup1" -location $location -DependsOn $resourceGroup

$resourceGroup2 = New-AzureNativeResourcesResourceGroup -pulumiid "MyResourceGroup2" -resourceGroupName "MyResourceGroup2" -location $location -DependsOn $resourceGroup, "{MyResourceGroup1}"
janegilring commented 2 years ago

Awesome!

However, is it intentional that -DependsOn is mandatory for New-AzureNativeResourcesResourceGroup?

New-AzureNativeResourcesResourceGroup -pulumiid testrg -resourceGroupName test-rg                                          

cmdlet New-AzureNativeResourcesResourceGroup at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
DependsOn: 

Update: It might be for more (all?) commands

cmdlet New-AzureNativeStorageStorageAccount at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
DependsOn: 
rdbartram commented 2 years ago

where were you yesterday when tested this 😀. I will get some tests written for this soon. will pushing a new version where it isnt required