OpenTofu lets you declaratively manage your cloud infrastructure.
Go to file
Martin Atkins 8f27409007 backend/remote: Support HCL variable values in local operations
For remote operations, the remote system (Terraform Cloud or Enterprise)
writes the stored variable values into a .tfvars file before running the
remote copy of Terraform CLI.

By contrast, for operations that only run locally (like
"terraform import"), we fetch the stored variable values from the remote
API and add them into the set of available variables directly as part
of creating the local execution context.

Previously in the local-only case we were assuming that all stored
variables are strings, which isn't true: the Terraform Cloud/Enterprise UI
allows users to specify that a particular variable is given as an HCL
expression, in which case the correct behavior is to parse and evaluate
the expression to obtain the final value.

This also addresses a related issue whereby previously we were forcing
all sensitive values to be represented as a special string "<sensitive>".
That leads to type checking errors for any variable specified as having
a type other than string, so instead here we use an unknown value as a
placeholder so that type checking can pass.

Unpopulated sensitive values may cause errors downstream though, so we'll
also produce a warning for each of them to let the user know that those
variables are not available for local-only operations. It's a warning
rather than an error so that operations that don't rely on known values
for those variables can potentially complete successfully.

This can potentially produce errors in situations that would've been
silently ignored before: if a remote variable is marked as being HCL
syntax but is not valid HCL then it will now fail parsing at this early
stage, whereas previously it would've just passed through as a string
and failed only if the operation tried to interpret it as a non-string.
However, in situations like these the remote operations like
"terraform plan" would already have been failing with an equivalent
error message anyway, so it's unlikely that any existing workspace that
is being used for routine operations would have such a broken
configuration.
2019-10-31 09:45:50 -07:00
.github Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
addrs Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
backend backend/remote: Support HCL variable values in local operations 2019-10-31 09:45:50 -07:00
builtin provisioner/puppet: fix bug when connection type was not set in config (#23057) 2019-10-17 11:46:55 -04:00
command command/jsonplan: fix bug with nested modules output (#23092) 2019-10-17 11:33:04 -04:00
communicator Update communicator/ssh/communicator.go 2019-10-02 15:03:18 -04:00
config config: Remove legacy interpolation function implementations 2019-10-29 08:25:45 -07:00
configs Merge pull request #22946 from hashicorp/kmoe/copy_dir_dotfiles 2019-10-24 12:01:42 -04:00
contrib contrib: Remove api-coverage tool 2019-10-18 11:22:30 -07:00
dag terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
digraph Fix TestWriteDot random order error 2014-07-29 10:26:50 -07:00
docs vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
e2e Standardise directory name for test data 2019-06-30 10:16:15 +02:00
examples Fix Google Cloud Platform name across docs. 2019-01-15 12:10:20 -08:00
flatmap prune references to config/module 2019-08-07 17:50:59 -04:00
helper Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
httpclient Merge pull request #22272 from hashicorp/f-httpclient-ua 2019-08-12 20:20:03 +01:00
internal backend/remote-state: etcdv3, oss, and manta acc tests should fail 2019-09-27 08:45:12 -04:00
lang correctly evaluate self in for_each resources 2019-10-29 12:44:42 -04:00
moduledeps plugin/discovery: PluginRequirements can specify SHA256 digests 2017-06-09 14:03:59 -07:00
plans Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
plugin Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
providers send and receive Private through ReadResource 2019-06-03 18:08:26 -04:00
provisioners provisioners: Add Factory type and FactoryFixed helper 2018-10-16 19:14:11 -07:00
registry Replace import paths & set UA string where necessary 2019-10-11 22:40:54 +01:00
repl vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
scripts make: Add check for protobuf dependencies 2019-09-05 14:30:54 +02:00
state Merge pull request #20571 from sergkondr/fix_misspelling 2019-08-13 17:13:13 -04:00
states Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
terraform failing test with for_each self reference 2019-10-29 12:14:30 -04:00
tfdiags Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
tools Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
vendor Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
version Cleanup after v0.12.12 release 2019-10-18 18:50:39 +00:00
website [Website] CherryServer doc links 2019-10-30 10:55:01 -07:00
.gitignore Standardise directory name for test data 2019-06-30 10:16:15 +02:00
.go-version build: Use Go 1.12.9 2019-08-16 16:29:43 -07:00
.hashibot.hcl apply special label for PRs affecting sdk paths 2019-09-06 15:22:43 -04:00
.tfdev .tfdev: remove platform build constraint 2019-08-09 15:10:52 -07:00
.travis.yml build: Use the official Go module proxy for Travis-CI runs (#22711) 2019-09-06 15:45:31 -04:00
BUILDING.md Revise our contributing/development documentation 2019-10-15 08:39:36 -07:00
CHANGELOG.md update CHANGELOG.md 2019-10-30 11:04:51 -04:00
checkpoint.go fixing version numbers RCs should be labeled x.x.x-rcx 2015-02-07 16:56:56 +01:00
CODEOWNERS First pass at adding CODEOWNERS to link remote-state backends with maintainers of the associated providers. 2019-02-11 15:52:19 -08:00
commands.go Replace import paths & set UA string where necessary 2019-10-11 22:40:54 +01:00
config.go command/cliconfig: Factor out CLI config handling 2019-08-01 10:56:41 -07:00
Dockerfile build: Stop using deprecated MAINTAINER in Dockerfile 2017-10-27 17:25:44 -07:00
go.mod go.mod: We only expect Go 1.12 2019-10-18 16:37:34 -07:00
go.sum Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
help.go help: Make version and help flags consistent 2018-08-01 14:28:39 -07:00
LICENSE Adding license 2014-07-28 13:54:06 -04:00
main_test.go main: make configuration available when initializing commands 2017-09-29 14:03:09 -07:00
main.go Replace import paths & set UA string where necessary 2019-10-11 22:40:54 +01:00
Makefile Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
panic.go panic: Instruct the user to include terraform's version for bug reports. 2015-05-14 18:14:56 -04:00
plugins.go keep .terraform.d/plugins for discovery 2017-08-09 17:46:49 -04:00
README.md Revise our contributing/development documentation 2019-10-15 08:39:36 -07:00
signal_unix.go Forward SIGTERM and handle that as an interrupt 2016-12-08 12:20:25 -05:00
signal_windows.go Forward SIGTERM and handle that as an interrupt 2016-12-08 12:20:25 -05:00
synchronized_writers.go main: synchronize writes to VT100-faker on Windows 2017-05-04 15:36:51 -07:00
version.go states/statemgr: Fix the Filesystem state manager tests 2018-11-19 09:02:35 -08: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, see the introduction section of the Terraform website.

Getting Started & Documentation

If you're new to Terraform and want to get started creating infrastructure, please checkout our Getting Started guide, available on the Terraform website.

All documentation is available on the Terraform website:

Developing Terraform

This repository contains only Terraform core, which includes the command line interface and the main graph engine. Providers are implemented as plugins that each have their own repository in the terraform-providers organization on GitHub. Instructions for developing each provider are in the associated README file. For more information, see the provider development overview.

To learn more about compiling Terraform and contributing suggested changes, please refer to the contributing guide.

License

Mozilla Public License v2.0