CompositionalIT / farmer

Repeatable Azure deployments with ARM templates - made easy!
https://compositionalit.github.io/farmer
MIT License
517 stars 156 forks source link

Subnet: Support `depends_on` #1071

Closed ninjarobot closed 8 months ago

ninjarobot commented 8 months ago

This PR closes #

The changes in this PR are as follows:

I have read the contributing guidelines and have completed the following:

If I haven't completed any of the tasks above, I include the reasons why here:

Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:

arm {
    add_resources
        [
            subnet {
                name "subnet1"
                link_to_unmanaged_vnet (virtualNetworks.resourceId vnetName)
                prefix "10.28.0.0/24"
            }
            // `subnet2` will not be deployed until the `subnet1` resource is deployed.
            subnet {
                name "subnet2"
                link_to_unmanaged_vnet (virtualNetworks.resourceId vnetName)
                prefix "10.28.1.0/24"
                depends_on (subnets.resourceId (ResourceName vnetName / ResourceName "subnet1"))
            }
        ]
}
ninjarobot commented 8 months ago

@Huaxinli123 please review and let me know if this addresses your need for depends_on support in the subnet builder.

ninjarobot commented 8 months ago

Thanks for confirming the fix @Huaxinli123 - will merge and release this soon.