Dependencies Error: Code="ResourceGroupNotFound"

Have simple code , which I had to deploy twice because got “ResourceGroupNotFound” . How do I configure dependencies ? I thought it is like pulumi where it is implicit.

const rg = new ResourceGroup(this, 'cdkrg', {
                name: 'TerraformRG',
                location: 'eastus'

            new VirtualNetwork(this, 'cdkvnet', {
                location: 'eastus',
                addressSpace: [''],
                name: 'TerraformVNet',

This is a known issue which is likely to be worked on soon.
In the meantime, you can manually add the dependsOn property to enforce the dependency.

1 Like