Go to file
Martin Atkins 70bc432f85 command/views/json: Never generate invalid diagnostic snippet offsets
Because our snippet generator is trying to select whole lines to include
in the snippet, it has some edge cases for odd situations where the
relevant source range starts or ends directly at a newline, which were
previously causing this logic to return out-of-bounds offsets into the
code snippet string.

Although arguably it'd be better for the original diagnostics to report
more reasonable source ranges, it's better for us to report a
slightly-inaccurate snippet than to crash altogether, and so we'll extend
our existing range checks to check both bounds of the string and thus
avoid downstreams having to deal with out-of-bounds indices.

For completeness here I also added some similar logic to the
human-oriented diagnostic formatter, which consumes the result of the
JSON diagnostic builder. That's not really needed with the additional
checks in the JSON diagnostic builder, but it's nice to reinforce that
this code can't panic (in this way, at least) even if its input isn't
valid.
2021-06-28 13:42:28 -07:00
.circleci tools: remove terraform-bundle. (#28876) 2021-06-03 14:08:04 -04:00
.github mailto is not supported in GitHub template URLs 2021-06-02 15:42:39 -05:00
docs docs: Some notes on adopting new Unicode versions 2021-06-03 08:34:58 -07:00
internal command/views/json: Never generate invalid diagnostic snippet offsets 2021-06-28 13:42:28 -07:00
scripts Remove revision from version command 2021-01-12 16:35:30 -05:00
tools An extra note about terraform-bundle with Terraform Enterprise 2021-06-10 11:24:06 -07:00
version Cleanup after v1.1.0-alpha20210616 release 2021-06-16 13:42:38 +00:00
website website: Explicit examples of -var escaping in various shells 2021-06-22 14:10:04 -07:00
.gitignore ignoring the vendor folder 2020-10-27 19:07:32 +01:00
.go-version update circleci to cimg to match release pipeline 2021-05-20 11:14:14 -04:00
.tfdev Remove revision from version command 2021-01-12 16:35:30 -05:00
BUGPROCESS.md Update BUGPROCESS.md 2020-12-10 12:15:39 -05:00
CHANGELOG.md Update CHANGELOG.md 2021-06-25 08:53:29 -04:00
CODEOWNERS update CODEOWNERS paths 2021-05-18 12:12:08 -04:00
Dockerfile switch to hashicorp docker mirror 2020-10-29 22:37:11 -04:00
LICENSE Adding license 2014-07-28 13:54:06 -04:00
Makefile Update various non-code references to renamed Go packages 2021-05-17 14:09:07 -07:00
README.md update to match new default branch name (#27909) 2021-02-24 13:36:47 -05:00
checkpoint.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
codecov.yml update to match new default branch name (#27909) 2021-02-24 13:36:47 -05:00
commands.go commands: `terraform add` (#28874) 2021-06-17 12:08:37 -04:00
go.mod go get github.com/zclconf/go-cty@v1.8.4 2021-06-21 12:14:14 -04:00
go.sum go get github.com/zclconf/go-cty@v1.8.4 2021-06-21 12:14:14 -04:00
help.go Update links to CLI docs in code comments, messages, and readme 2021-01-22 12:22:21 -08:00
main.go terraform: use ProtocolVersion from unmanaged providers' reattachConfig to chose the correct PluginClient (#28190) 2021-05-18 10:59:14 -04:00
main_test.go don't error when processing autocomplete commands 2021-03-31 13:28:08 -04:00
plugins.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
provider_source.go Move command/ to internal/command/ 2021-05-17 14:09:07 -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
version.go Remove revision from version command 2021-01-12 16:35:30 -05: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, 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, 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