Terraform - Infrastructure as Code
Find a file
Martin Atkins 0f845adfdb moduletest: EvalContext lives outside of the "terraform" package
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.
2023-12-01 09:07:35 -08:00
.github pin the image sha for good measure 2023-09-21 10:37:11 -07:00
.release Change release order of operations 2023-10-02 19:01:52 -07:00
docs stacks: Summary docs giving an overview and some details about stackeval 2023-11-28 12:07:49 -08:00
internal moduletest: EvalContext lives outside of the "terraform" package 2023-12-01 09:07:35 -08:00
scripts Exit CD when fail for a variety of reasons 2023-10-27 17:06:39 -04:00
testing/equivalence-tests Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
tools tfstackdata1: Protobuf schema for stack plan and state serialization 2023-11-15 12:38:52 -08:00
version cleanup after 1.7.0-alpha20231130 release 2023-11-30 18:14:55 +01:00
website docs: update terraform test docs with provider to run block reference examples (#34332) 2023-11-30 16:53:57 +01:00
.copywrite.hcl update license for provider plugin protocol files 2023-08-16 11:21:41 -07:00
.gitignore Fix .gitignore terraform entry to be root-relative 2022-05-05 10:24:38 -04:00
.go-version go.mod: Use Go v1.21.3 and some other dependency upgrades 2023-10-25 09:07:06 -07:00
.tfdev Remove revision from version command 2021-01-12 16:35:30 -05:00
BUGPROCESS.md Update BUGPROCESS.md 2023-03-18 17:14:20 -04:00
BUILDING.md elaborate further on experiments and cgo 2023-07-17 11:56:13 -07:00
CHANGELOG.md cleanup after 1.7.0-alpha20231130 release 2023-11-30 18:14:55 +01:00
checkpoint.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
codecov.yml Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
CODEOWNERS Update codeowner of gcs backend to include Strategic Integrations team (#31848) 2022-09-27 21:38:52 +01:00
commands.go main: The "terraform rpcapi" command is experimental 2023-11-15 12:38:57 -08:00
copyright_headers.go stick with go generate check instead 2023-08-30 14:25:49 -07:00
Dockerfile Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
experiments.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
go.mod Updates aws-sdk-go-base 2023-11-28 15:22:29 -08:00
go.sum Updates aws-sdk-go-base 2023-11-28 15:22:29 -08:00
help.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
LICENSE Update LICENSE (#34304) 2023-11-28 16:14:14 +00:00
main.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
main_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
Makefile stick with go generate check instead 2023-08-30 14:25:49 -07:00
plugins.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
provider_source.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
README.md update licence link in README to BSL 2023-08-11 11:25:40 +02:00
signal_unix.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
signal_windows.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
staticcheck.conf Add staticcheck.conf to reduce unactionable noise in IDEs (#34036) 2023-10-12 11:01:12 -07:00
telemetry.go add missing copyright headers 2023-08-16 11:21:49 -07:00
tools.go run copyright header check recursively 2023-08-30 14:25:49 -07:00
version.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
working_dir.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00

Terraform

Terraform

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.

License

Business Source License 1.1