INNER CODE UNIT · Python
TerraformTest
GoogleCloudPlatform/terraform-python-testing-helper · tftest.py:253
class TerraformTest(object):
"""Helper class for use in testing Terraform modules.
This helper class can be used to set up fixtures in Terraform tests, so that
the usual Terraform commands (init, plan, apply, output, destroy) can be run
on a module. Configuration is done at instantiation first, by passing in the
Terraform root module path, and then in the setup method through files that
will be temporarily linked in the module, and Terraform variables.
The standard way of using this is by calling setup to configure the module
through temporarily linked Terraform files and variables, run one or more
Terraform commands, then check command output, state, or created resources
from individual tests.
The local .terraform directory (including local state) and any linked file
are removed when the instance is garbage collected. Destroy needs to be
called explicitly using destroy().