Go to file
Martin Atkins ff0dbd6215 command/fmt: Restore some opinionated behaviors
In Terraform 0.11 and earlier, the "terraform fmt" command was very
opinionated in the interests of consistency. While that remains its goal,
for pragmatic reasons Terraform 0.12 significantly reduced the number
of formatting behaviors in the fmt command. We've held off on introducing
0.12-and-later-flavored cleanups out of concern it would make it harder
to maintain modules that are cross-compatible with both Terraform 0.11
and 0.12, but with this aimed to land in 0.14 -- two major releases
later -- our new goal is to help those who find older Terraform language
examples learn about the more modern idiom.

More rules may follow later, now that the implementation is set up to
allow modifications to tokens as well as modifications to whitespace, but
for this initial pass the command will now apply the following formatting
conventions:

 - 0.11-style quoted variable type constraints will be replaced with their
   0.12 syntax equivalents. For example, "string" becomes just string.
   (This change quiets a deprecation warning.)
 - Collection type constraints that don't specify an element type will
   be rewritten to specify the "any" element type explicitly, so
   list becomes list(any).
 - Arguments whose expressions consist of a quoted string template with
   only a single interpolation sequence inside will be "unwrapped" to be
   the naked expression instead, which is functionally equivalent.
   (This change quiets a deprecation warning.)
 - Block labels are given in quotes.

Two of the rules above are coming from a secondary motivation of
continuing down the deprecation path for two existing warnings, so authors
can have two active deprecation warnings quieted automatically by
"terraform fmt", without the need to run any third-party tools.

All of these rules match with current documented idiom as shown in the
Terraform documentation, so anyone who follows the documented style should
see no changes as a result of this. Those who have adopted other local
style will see their configuration files rewritten to the standard
Terraform style, but it should not make any changes that affect the
functionality of the configuration.

There are some further similar rewriting rules that could be added in
future, such as removing 0.11-style quotes around various keyword or
static reference arguments, but this initial pass focused only on some
rules that have been proven out in the third-party tool
terraform-clean-syntax, from which much of this commit is a direct port.

For now this doesn't attempt to re-introduce any rules about vertical
whitespace, even though the 0.11 "terraform fmt" would previously apply
such changes. We'll be more cautious about those because the results of
those rules in Terraform 0.11 were often sub-optimal and so we'd prefer
to re-introduce those with some care to the implications for those who
may be using vertical formatting differences for some semantic purpose,
like grouping together related arguments.
2020-09-28 09:04:03 -07:00
.circleci Merge pull request #26358 from hashicorp/jbardin/no-vendor 2020-09-24 10:57:02 -04:00
.github Merge pull request #26247 from hashicorp/danieldreier/bugtriage 2020-09-25 15:59:05 -04:00
addrs addrs: Resource.InModule, similar to Resource.Absolute 2020-08-24 11:41:28 -07:00
backend insert PlanRefresh into the context 2020-09-24 09:34:49 -04:00
builtin always return original workspace, even when null 2020-06-24 13:41:51 -04:00
command command/fmt: Restore some opinionated behaviors 2020-09-28 09:04:03 -07:00
communicator communicator/winrm: include configured timeout in winrm server 2020-06-25 08:41:09 -04:00
configs configs: Deprecate nested redundant interpolations 2020-09-22 13:40:08 -04:00
contrib contrib: Remove api-coverage tool 2019-10-18 11:22:30 -07:00
dag quote dot node names 2020-06-15 13:28:53 -04:00
digraph Fix TestWriteDot random order error 2014-07-29 10:26:50 -07:00
docs docs: Provider protocol wire format for values 2020-09-01 10:40:36 -07:00
e2e remove vendor from some tooling 2020-09-23 17:06:59 -04:00
examples Fix Google Cloud Platform name across docs. 2019-01-15 12:10:20 -08:00
experiments Create experiment for sensitive attribute 2020-09-10 11:04:17 -04:00
flatmap prune references to config/module 2019-08-07 17:50:59 -04:00
helper fix error string matching in test 2020-09-23 16:43:40 -04:00
httpclient Merge pull request #22272 from hashicorp/f-httpclient-ua 2019-08-12 20:20:03 +01:00
instances Expander.ExpandResource cannot expand all modules 2020-03-25 11:58:23 -04:00
internal getproviders: Prepare for having multiple valid hashes per package 2020-09-24 14:01:54 -07:00
lang lang/funcs: Add "alltrue" function (#25656) 2020-09-22 09:06:42 -04:00
moduledeps rename provider-specific functions (#24417) 2020-03-20 13:59:59 -04:00
plans Support lists of deeply marked values 2020-09-25 13:33:44 -04:00
plugin plugin/discovery: Remove dead code 2020-05-28 15:20:41 -04:00
providers Store sensitive attribute paths in state (#26338) 2020-09-24 12:40:17 -04:00
provisioners provisioners: Add Factory type and FactoryFixed helper 2018-10-16 19:14:11 -07:00
registry registry: Fix panic when server is unreachable 2020-03-19 10:20:10 -04:00
repl repl: Improved value renderer for console outputs 2020-09-14 09:47:12 -04:00
scripts use alpine:latest as the base image for terraform docker containers 2020-07-01 16:03:06 -04:00
states Store sensitive attribute paths in state (#26338) 2020-09-24 12:40:17 -04:00
terraform terraform: Check for sensitive values in outputs 2020-09-25 16:04:06 -04:00
tfdiags tfdiags: Diagnostics.ToHCL 2020-03-12 11:11:29 -07:00
tools Update CHANGELOG.md 2020-09-28 10:34:25 -04:00
version Cleanup after v0.14.0-alpha20200923 release 2020-09-23 18:19:52 +00:00
website Merge pull request #26337 from hashicorp/pselle/docs-vendor-provisioners 2020-09-22 14:54:21 -04:00
.gitignore Coverage 2020-03-03 13:01:05 -05:00
.go-version update to go1.15.2 2020-09-23 15:18:22 -04:00
.hashibot.hcl hashibot: Temporarily disable issue migration 2020-09-22 14:41:18 -07:00
.tfdev .tfdev: remove platform build constraint 2019-08-09 15:10:52 -07:00
BUGPROCESS.md Add bug triage guide 2020-09-25 15:56:58 -04:00
CHANGELOG.md CHANGELOG: Differences that come from our upgrade to Go 1.15 2020-09-24 14:34:52 -07:00
CODEOWNERS Add remilapeyre to CODEOWNERS 2020-08-19 14:25:19 +02:00
Dockerfile build: Don't create apk cache in "full" docker image 2019-11-11 16:04:23 -08:00
LICENSE Adding license 2014-07-28 13:54:06 -04:00
Makefile remove vendor from some tooling 2020-09-23 17:06:59 -04:00
README.md Add bug triage guide 2020-09-25 15:56:58 -04:00
checkpoint.go Remove config.go and update things using its aliases 2020-01-13 16:50:05 -05:00
codecov.yml build: put codecov in informational mode (#26271) 2020-09-17 08:13:50 -04:00
commands.go main: new global option -chdir 2020-09-04 15:31:08 -07:00
go.mod go get github.com/hashicorp/hcl/v2@a0de289809fb 2020-09-25 11:30:27 -04:00
go.sum go get github.com/hashicorp/hcl/v2@a0de289809fb 2020-09-25 11:30:27 -04:00
help.go main: new global option -chdir 2020-09-04 15:31:08 -07:00
main.go main: new global option -chdir 2020-09-04 15:31:08 -07:00
main_test.go main: make configuration available when initializing commands 2017-09-29 14:03:09 -07:00
panic.go main: Warn about potential sensitive information in logs when panicking 2019-11-06 14:12:33 -08:00
plugins.go Remove config.go and update things using its aliases 2020-01-13 16:50:05 -05:00
provider_source.go internal/getproviders: HTTPMirrorSource implementation 2020-08-26 13:18:08 -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

README.md

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

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 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.

To learn more about how we handle bug reports, please read the bug triage guide.

License

Mozilla Public License v2.0