# Dependencies Error: Code="ResourceGroupNotFound"

**URL:** <https://discuss.hashicorp.com/t/dependencies-error-code-resourcegroupnotfound/12578>\
**Category:** CDK for Terraform\
**Created:** [August 10, 2020, 3:19am UTC](https://discuss.hashicorp.com/t/dependencies-error-code-resourcegroupnotfound/12578 "2020-08-10T03:19:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![irom77](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/irom77/32/10327_2.png) [@irom77](https://discuss.hashicorp.com/u/irom77)\
**Post date:** [August 10, 2020, 3:19am UTC](https://discuss.hashicorp.com/t/dependencies-error-code-resourcegroupnotfound/12578/1 "2020-08-10T03:19:33Z")

</div>

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: ['10.1.0.0/24'],
                name: 'TerraformVNet',
                resourceGroupName: rg.name
            })
```

---

<div class="post-metadata">

**Author:** ![jsteinich](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jsteinich/32/9502_2.png) [@jsteinich](https://discuss.hashicorp.com/u/jsteinich)\
**Post date:** [August 10, 2020, 3:26am UTC](https://discuss.hashicorp.com/t/dependencies-error-code-resourcegroupnotfound/12578/2 "2020-08-10T03:26:55Z")

</div>

This is a [known issue](https://github.com/hashicorp/terraform-cdk/issues/188) which is likely to be worked on soon.  
In the meantime, you can manually add the `dependsOn` property to enforce the dependency.
