terraform: properly encode module dependencies in state