Difference between revisions of "Terraform test"
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
== Related == | == Related == | ||
* [[test]] | * [[test]] | ||
+ | * [[terraform plan]] | ||
== See also == | == See also == |
Revision as of 10:37, 7 February 2024
- terraform test: Providers, modules, resources, and data sources can now be mocked during executions of terraform test. The following new blocks have been introduced within .tftest.hcl files:
- mock_provider: Can replace provider instances with mocked providers, allowing tests to execute in command = apply mode without requiring a configured cloud provider account and credentials. Terraform will create fake resources for mocked providers and maintain them in state for the lifecycle of the given test file.
- override_resource: Specific resources can be overridden so Terraform will create a fake resource with custom values instead of creating infrastructure for the overridden resource.
- override_data: Specific data sources can be overridden so data can be imported into tests without requiring real infrastructure to be created externally first.
- override_module: Specific modules can be overridden in their entirety to give greater control over the returned outputs without requiring in-depth knowledge of the module itself.
Related
See also
Advertising: