GoogleCloudPlatform / terraform-python-testing-helper

Simple Python test helper for Terraform.
https://pypi.org/project/tftest/
Apache License 2.0
214 stars 31 forks source link

Add capability to use terraform workspaces #36

Closed grahamhar closed 2 years ago

grahamhar commented 2 years ago

Some of the test approaches we need to take have a dependency on the use of Terraform workspaces. Before working on a PR to add this feature I'd like to get some feedback on if this is a feature that fits with this project.

My first thought on an approach is to add a new optional parameter to the setup function that allows a Terraform workspace name to be provided and if it is creation/selection of the workspace would be carried out after the init.

ludoo commented 2 years ago

Hey Graham, use case seems completely valid, and as you wrote the path of least resistance is to try and make it work by adding an option. Do you have time to send a PR? I'm a bit busy but might also get to it eventually.

grahamhar commented 2 years ago

I'll try to pull something together in the next week or so.