terraform: fix potential case where cycle is made
Merge branch 'master' of https://github.com/hashicorp/terraform