The initial implementation of the module testing language included some
elements deeply embedded inside "package terraform", which is primarily
concerned with the traditional Terraform language, which we might now call
the "module language" to distinguish it from the test language and the
stacks language.
That was a reasonable design decision due to the modules runtime needing
to evaluate some expressions in a similar way to how the modules language
does it, but unfortunately it caused the test language runtime to depend
a little too closely on some current implementation details of how the
modules runtime deals with expression evaluation, and those details are
about to change as we teach Terraform to be able to deal with unknown
values in new places, as part of resolving this issue:
https://github.com/hashicorp/terraform/issues/30937
This commit therefore refactors the test runtime a little so that it
doesn't intrude so deeply into the module runtime's business. Instead of
directly extending the module runtime's expression evaluator, we'll
instead call into it in a similar way to how the "terraform console"
command does, by wrapping the evaluation data produced by the module
runtime to extend it with the only two special things that the test
runtime needs: references to the output values of previous runs, and
references to test-only variables that aren't declared as part of the
module under test.
This effectively means that the test runtime can now evaluate a superset
of the expressions that would be valid in the global scope of the module
under test using only the public API of the modules runtime, with no
testing-specific evaluation logic embedded inside the modules runtime.
This new strategy is also somewhat similar to how the stacks runtime calls
into the modules runtime to evaluate components, but the stacks runtime
only actually cares about output values and so doesn't need a full
evaluation scope. This means the result here is a little more symmetrical
with the approach we took in stacks, which will hopefully allow experience
working on one to translate better to the other.
|
||
|---|---|---|
| .github | ||
| .release | ||
| docs | ||
| internal | ||
| scripts | ||
| testing/equivalence-tests | ||
| tools | ||
| version | ||
| website | ||
| .copywrite.hcl | ||
| .gitignore | ||
| .go-version | ||
| .tfdev | ||
| BUGPROCESS.md | ||
| BUILDING.md | ||
| CHANGELOG.md | ||
| checkpoint.go | ||
| codecov.yml | ||
| CODEOWNERS | ||
| commands.go | ||
| copyright_headers.go | ||
| Dockerfile | ||
| experiments.go | ||
| go.mod | ||
| go.sum | ||
| help.go | ||
| LICENSE | ||
| main.go | ||
| main_test.go | ||
| Makefile | ||
| plugins.go | ||
| provider_source.go | ||
| README.md | ||
| signal_unix.go | ||
| signal_windows.go | ||
| staticcheck.conf | ||
| telemetry.go | ||
| tools.go | ||
| version.go | ||
| working_dir.go | ||
Terraform
- Website: https://www.terraform.io
- Forums: HashiCorp Discuss
- Documentation: https://www.terraform.io/docs/
- Tutorials: HashiCorp's Learn Platform
- Certification Exam: HashiCorp Certified: Terraform Associate
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.
The key features of Terraform are:
-
Infrastructure as Code: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.
-
Execution Plans: Terraform has a "planning" step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.
-
Resource Graph: Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.
-
Change Automation: Complex changesets can be applied to your infrastructure with minimal human interaction. With the previously mentioned execution plan and resource graph, you know exactly what Terraform will change and in what order, avoiding many possible human errors.
For more information, refer to the What is Terraform? page on the Terraform website.
Getting Started & Documentation
Documentation is available on the Terraform website:
If you're new to Terraform and want to get started creating infrastructure, please check out our Getting Started guides on HashiCorp's learning platform. There are also additional guides to continue your learning.
Show off your Terraform knowledge by passing a certification exam. Visit the certification page for information about exams and find study materials on HashiCorp's learning platform.
Developing Terraform
This repository contains only Terraform core, which includes the command line interface and the main graph engine. Providers are implemented as plugins, and Terraform can automatically download providers that are published on the Terraform Registry. HashiCorp develops some providers, and others are developed by other organizations. For more information, see Extending Terraform.
-
To learn more about compiling Terraform and contributing suggested changes, refer to the contributing guide.
-
To learn more about how we handle bug reports, refer to the bug triage guide.
-
To learn how to contribute to the Terraform documentation in this repository, refer to the Terraform Documentation README.