Commit Graph

25170 Commits

Author SHA1 Message Date
Martin Atkins 2a95d98383 docs: terraform state show is not machine-readable
In earlier versions of Terraform the result of terraform state show was
in the pre-0.12 "flatmap" structure that was unable to reflect nested
data structures. That was fixed in Terraform 0.12, but as a consequence
this statement about the output being machine-parseable (which was
debateable even in older versions) is incorrect.

Fortunately, we now have "terraform show -json" to get output that is
intentionally machine-parseable, so we'll recommend to use that instead
here. The JSON output of that command is a superset of what's produced by
"terraform state show", so should be usable to meet any use-case that
might previously have been met by parsing the "terraform state show"
output.
2020-01-07 09:39:20 -08:00
Martin Atkins 2b2ac1f6de configs: use local set of go-getter detectors
In an earlier change we switched to defining our own sets of detectors,
getters, etc for go-getter in order to insulate us from upstream changes
to those sets that might otherwise change the user-visible behavior of
Terraform's module installer.

However, we apparently neglected to actually refer to our local set of
detectors, and continued to refer to the upstream set. Here we catch up
with the latest detectors from upstream (taken from the version of
go-getter we currently have vendored) and start using that fixed set.

Currently we are maintaining these custom go-getter sets in two places
due to the configload vs. initwd distinction. That was already true for
goGetterGetters and goGetterDecompressors, and so I've preserved that for
now just to keep this change relatively simple; in later change it would
be nice to factor these "get with go getter" functions out into a shared
location which we can call from both configload and initwd.
2020-01-07 09:38:46 -08:00
Pam Selle 948d4d0ecf
Merge pull request #23749 from jasonwalsh/master
website: update publishing modules documentation
2020-01-07 16:58:36 +01:00
James Bardin ae407060f0
Merge pull request #23791 from hashicorp/jbardin/state-mv
remove stale dependencies on `state mv`
2020-01-06 16:02:22 -05:00
Pam Selle 4977120764
Merge pull request #23733 from GennadySpb/patch-1
Change Yandex.Cloud provider name in index
2020-01-06 21:37:03 +01:00
James Bardin 98c02ac114 remove stale dependencies on `state mv`
Clear any Dependencies if there is an entry matching a `state mv` from
address. While stale dependencies won't directly effect any current
operations, clearing the list will allow them to be recreated in their
entirety during refresh. This will help future releases that may rely
solely on the pre-calculated dependencies for destruction ordering.
2020-01-06 15:06:41 -05:00
Martin Atkins dc178789b2
Update CHANGELOG.md 2020-01-06 10:25:01 -08:00
Martin Atkins 7f8e087ce3 core: Don't panic if EvalMaybeResourceDeposedObject has no DeposedKey
This is a "should never happen" case, but we have reports of it actually
happening. In order to try to collect a bit more data about what's going
on here, we're changing what was previously a hard panic into a normal
error message that can include the address of the instance we were working
on and the action we were trying to do to it at the time.

The hope is to narrow down what situations can trigger this in order to
find a reliable reproduction case in order to debug further. This also
means that for those who _do_ encounter this problem in the meantime
Terraform will have a chance to shut down cleanly and therefore be more
likely to be able to recover on a subsequent plan/apply cycle.

Further investigation of this will follow once we see a report or two of
this updated error message.
2020-01-06 10:22:51 -08:00
jasonwalsh 62aae82913
website: update publishing modules documentation 2019-12-24 10:22:59 -05:00
Nick Fagerlund 413e423bba website: Use canonical URLs for learn.hashicorp.com links
The .html suffix redirects correctly, but it's not the 'real' path and thus
can throw off analytics.
2019-12-20 16:06:00 -08:00
GennadySpb e4c4c8cab5
Change Yandex.Cloud provider name in index
'Yandex' -> 'Yandex.Cloud'
2019-12-20 11:48:40 +03:00
Nick Fagerlund c0176aeab3 website: Revise sensitive data in state page 2019-12-18 11:39:04 -08:00
Pam Selle f1237f816c
Merge pull request #23151 from jeschkies/patch-1
Correct simple typo in `walk.go`.
2019-12-17 16:33:44 +01:00
James Bardin 37d2202afe
Merge pull request #23696 from hashicorp/jbardin/orphan-resource-provider
NodeDestroyResource does not need a provider
2019-12-17 09:09:44 -05:00
Pam Selle d2fc7aad87
Merge pull request #23268 from rajata07/master
small fix with command usage 'terraform workspace New'
2019-12-17 07:37:20 -05:00
Pam Selle 76831793d0
Merge pull request #23265 from lucazz/update_docs_for_outputs
Update Output values docs
2019-12-17 07:34:46 -05:00
Pam Selle 3bcea18d1c
Update outputs.html.md 2019-12-17 07:33:11 -05:00
Pam Selle 31b56207e0
Update outputs.html.md 2019-12-17 07:32:22 -05:00
Pam Selle a93298bd14
Merge pull request #23656 from hashicorp/paddy_gcs_backend_env_var
Add a backend-specific env var for the GCS backend.
2019-12-17 07:30:41 -05:00
Pam Selle b25ca47b30
Merge pull request #23687 from IgorVodka/patch-1
website: Fix inpage link in docs
2019-12-17 07:29:30 -05:00
James Bardin 414cbbe808 NodeDestroyResource does not need a provider
The resource cleanup node does not need a provider. We can't directly
remove the ProvidedBy method, but this node only needs to be eval-able
so we can remove all the NodeAbstractResource methods at once.
2019-12-16 17:55:49 -05:00
James Bardin a119ac17a4
Merge pull request #23661 from jcaamano/master
ssh: Fix deadlock on agent forwarding error
2019-12-16 11:06:49 -05:00
Igor Vodka be89975667
Fix markdown being misused in docs 2019-12-16 16:29:47 +03:00
Kristin Laemmert 2f36a82091
Merge pull request #23658 from hashicorp/mildwonkey/b-terrafrom-bundle
terraform-bundle: fix panic with addrs.Provider
2019-12-13 08:00:19 -05:00
James Bardin 2eb4651a3b
Merge pull request #23663 from hashicorp/jbardin/resource-connection-refs
check resource-level connections block for references
2019-12-12 21:08:13 -05:00
Pam Selle 5db7afa545
Merge pull request #23645 from patryk/patch-1
Cloudflare, not CloudFlare
2019-12-12 16:48:14 -05:00
Pam Selle 41675543c8
Merge pull request #23627 from alrs/fix-backend-remote-state-dropped-test-errs
Fix backend remote state dropped test errors
2019-12-12 15:21:29 -05:00
Martin Atkins 9a17497d3f vendor: go get github.com/hashicorp/hcl/v2@v2.2.0
This also includes an upgrade to cty v1.1.1 because HCL calls for it.

The changes in these two libraries are mainly to codepaths that don't
directly affect Terraform, but including this upgrade will cause some
small improvements to Terraform's error messages for type conversion
problems.
2019-12-12 10:36:23 -08:00
James Bardin a57337327d check resource-level connections block for refs
References from a resource-level connection blocks were not returned
from NodeAbstractResource.References, causing the provisioner connection
attributes to sometimes be evaluated too early.
2019-12-12 12:57:23 -05:00
Pam Selle 7ed1add7e0
Merge pull request #23625 from hashicorp/fix-typo
Fix typo in changelog
2019-12-12 12:44:18 -05:00
Jaime Caamaño Ruiz c3a61a040e ssh: Fix deadlock on agent forwarding error
If there is an error when opening the session for agent forwarding in
the process ssh connention, there is a deadlock when recursively
calling Connect on an internal reattempt. Avoid that, and let the
connection be reattempted externally.
2019-12-12 18:16:17 +01:00
Kristin Laemmert c72d2c6c44 build: add terraform-bundle e2etests 2019-12-12 09:26:26 -05:00
Kristin Laemmert 8c6ae66494 terraform-bundle: fix panic with addrs.Provider
Fixes #23652
2019-12-12 09:14:38 -05:00
Paddy Carver b8752c7610 Add a backend-specific env var for the GCS backend.
Right now, the only environment variable available is the same
environment variable that will be picked up by the GCP provider. Users
would like to be able to store state in separate projects or accounts or
otherwise authenticate to the provider with a service account that
doesn't have access to the state. This seems like a reasonable enough
practice to me, and the solution seems straightforward--offer an
environment variable that doesn't mean anything to the provider to
configure the backend credentials. I've added GOOGLE_BACKEND_CREDENTIALS
to manage just the backend credentials, and documented it appropriately.
2019-12-12 03:35:39 -08:00
Martin Atkins bfbd00a23c website: Note about using jsonencode/yamlencode in templatefile
It's a common source of errors to try to produce JSON or YAML syntax
using string concatenation via our template language but to miss some
details like correct string escaping, quoting, required commas, etc.

The jsonencode and yamlencode functions are a better way to generate JSON
and YAML, but it's not immediately obvious that both of these functions
are available for use in external templates (via templatefile) too.

Given that questions related to this come up a lot in our community forum
and elsewhere, it seems worth having a documentation section to show the
pattern of having a template that consists only of a single function call.
2019-12-11 12:57:01 -08:00
tf-release-bot 28880aa47d Cleanup after v0.12.18 release 2019-12-11 16:29:59 +00:00
tf-release-bot 0bda605bc1
v0.12.18 2019-12-11 16:14:26 +00:00
Patryk Szczygłowski 03739a99ff
Cloudflare, not CloudFlare 2019-12-11 16:00:33 +00:00
Kristin Laemmert 49fc53d1d1
provider source enhancements
* configs: move ProviderConfigCompact[Str] from addrs to configs

The configs package is aware of provider name and type (which are the
same thing today, but expected to be two different things in a future
release), and should be the source of truth for a provider config
address. This is an intermediate step; the next step will change the returned types to something based in the configs package.

* command: rename choosePlugins to chooseProviders to clarify scope of function

* use `Provider.LegacyString()` (instead of `Provider.Type`) consistently
* explicitly create legacy-style provider (continuing from above change)
2019-12-11 08:35:55 -05:00
Martin Atkins 5a8ca31d48
Update CHANGELOG.md 2019-12-10 11:55:20 -08:00
Martin Atkins c06675c616 command: New -compact-warnings option
When warnings appear in isolation (not accompanied by an error) it's
reasonable to want to defer resolving them for a while because they are
not actually blocking immediate work.

However, our warning messages tend to be long by default in order to
include all of the necessary context to understand the implications of
the warning, and that can make them overwhelming when combined with other
output.

As a compromise, this adds a new CLI option -compact-warnings which is
supported for all the main operation commands and which uses a more
compact format to print out warnings as long as they aren't also
accompanied by errors.

The default remains unchanged except that the threshold for consolidating
warning messages is reduced to one so that we'll now only show one of
each distinct warning summary.

Full warning messages are always shown if there's at least one error
included in the diagnostic set too, because in that case the warning
message could contain additional context to help understand the error.
2019-12-10 11:53:14 -08:00
Pam Selle 5421a62eae
Merge pull request #23401 from sclaire-1/master
Edit BUILDING.md
2019-12-10 14:17:20 -05:00
Pam Selle 63df95dbca
Update CHANGELOG.md 2019-12-10 13:13:00 -05:00
Pam Selle d45a4d33bb
Merge pull request #22963 from rekahsoft/s3-backend-pagination
Allow s3 backends to contain more then 1000 workspaces
2019-12-10 13:11:45 -05:00
Pam Selle a4b0de1b78
Merge pull request #23631 from pselle/s3AccFix
Fix S3 test
2019-12-10 13:11:12 -05:00
Pam Selle 45fa6a3145 Fix S3 test 2019-12-10 12:48:08 -05:00
Martin Atkins b90fb25321 experiments: a mechanism for opt-in experimental language features
Traditionally we've preferred to release new language features in major
releases only, because we can then use the beta cycle to gather feedback
on the feature and learn about any usability challenges or other
situations we didn't consider during our design in time to make those
changes before inclusion in a stable release.

This "experiments" feature is intended to decouple the feedback cycle for
new features from the major release rhythm, and thus allow us to release
new features in minor releases by first releasing them as experimental for
a minor release or two, adjust for any feedback gathered during that
period, and then finally remove the experiment gate and enable the feature
for everyone.

The intended model here is that anything behind an experiment gate is
subject to breaking changes even in patch releases, and so any module
using these experimental features will be broken by a future Terraform
upgrade.

The behavior implemented here is:

- Recognize a new "experiments" setting in the "terraform" block which
  allows module authors to explicitly opt in to experimental features.

  terraform {
    experiments = [resource_for_each]
  }

- Generate a warning whenever loading a module that has experiments
  enabled, to avoid accidentally depending on experimental features and
  thus risking unexpected breakage on next Terraform upgrade.

- We check the enabled experiments against the configuration at module
  load time, which means that experiments are scoped to a particular
  module. Enabling an experiment in one module does not automatically
  enable it in any other module.

This experiments mechanism is itself an experiment, and so I'd like to
use the resource for_each feature to trial it. Because any configuration
using experiments is subject to breaking changes, we are free to adjust
this experiments feature in future releases as we see fit, but once
for_each is shipped without an experiment gate we'll be blocked from
making significant changes to it until the next major release at least.
2019-12-10 09:27:05 -08:00
Lars Lehtonen 77ffb4a0eb
backend/remote-state/http: fix dropped test errors 2019-12-10 07:36:54 -08:00
Lars Lehtonen 2845896fc9
backend/remote-state/http: drop unused assertError() 2019-12-10 07:33:22 -08:00
Alvin Huang a99a807b59
Fix typo in changelog 2019-12-10 09:39:52 -05:00