Commit Graph

25112 Commits

Author SHA1 Message Date
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
Pam Selle
9efab422ba
Merge pull request #23611 from pselle/vendor
Run of vendor and tidy
2019-12-09 11:54:00 -05:00
Pam Selle
717ed70c21 Run of vendor and tidy 2019-12-09 11:34:12 -05:00
Pam Selle
befb3dadfa
Merge pull request #23574 from hashicorp/changelog-notarization-info
Add notarization details to changelog
2019-12-06 15:59:24 -05:00
Michele
9c4582e42a Update changelog 2019-12-06 09:56:10 -08:00
James Bardin
f281eb2b44
Merge pull request #23595 from hashicorp/jbardin/deprecate-destroy-references
Update destroy provisioner warnings
2019-12-06 12:31:20 -05:00
Pam Selle
9ef44b72b3
Update CHANGELOG.md 2019-12-06 12:10:33 -05:00
Pam Selle
d8c31a1efa
Merge pull request #23581 from hashicorp/pselle/show-panic-23377
Fix panic on show plan
2019-12-06 12:08:16 -05:00
Pam Selle
9c4d3cc1b1 Add a test 2019-12-06 11:53:43 -05:00
James Bardin
b9d48d3173
Merge pull request #23596 from hashicorp/jbardin/fix-state-test
Fix tests
2019-12-06 11:18:14 -05:00
James Bardin
42a2bb4da3 expand test tempdir symlinks to fix tests on macos 2019-12-06 10:56:47 -05:00
James Bardin
96d1e57191 fix type in state mv test 2019-12-06 10:52:14 -05:00
James Bardin
b715ef2590 don't print just warnings when loading backend cfg
Any warnings will be caught again when the entire config is loaded, and
duplicated in the output.
2019-12-06 10:20:23 -05:00
James Bardin
2fdf984cce update destroy provisioner warning text
Make it a little more user-oriented
2019-12-06 10:20:23 -05:00
Kristin Laemmert
e3416124cc
addrs: replace "Type string" with "Type Provider" in ProviderConfig
* huge change to weave new addrs.Provider into addrs.ProviderConfig
* terraform: do not include an empty string in the returned Providers /
Provisioners
- Fixed a minor bug where results included an extra empty string
2019-12-06 08:00:18 -05:00
Chris Griggs
b2f7d80c3d
Merge pull request #23584 from hashicorp/cgriggs01-stackpath-links
[Website] add stackpath links
2019-12-05 16:42:58 -08:00
cgriggs01
c355fbd67c add stackpath links 2019-12-05 16:29:01 -08:00
Michele
4bdc85c182 Add caveat about double-clicking binary 2019-12-05 15:35:18 -08:00
Martin Atkins
161e6d6dbf
Update CHANGELOG.md 2019-12-05 15:29:14 -08:00
Martin Atkins
28850a3f1d
Update CHANGELOG.md 2019-12-05 15:27:29 -08:00
Martin Atkins
97d64581c6 helper/logging: Loosen the filtering heuristic even more
Now we'll consider any message that doesn't start with a digit as a
continuation. This is _definitely_ in loose, best-effort territory now
since a continuation line could very well start with a digit, but
ultimately this is still better than the totally broken behavior that
preceded it.

Just to make sure that none of these heuristics interfere with producing
complete, accurate logs for TRACE, we'll skip the LevelFilter altogether
in that case.
2019-12-05 15:22:03 -08:00
Martin Atkins
faffb3a784 helper/logging: Warn about levels other than TRACE
The filtering for other log levels is unreliable and glitchy because it's
trying to infer information from the log stream that isn't reliably
represented.

Although the previous commit has improved the situation somewhat, it is
still a tricky and unreliable heuristic, so worth a warning to anyone who
is reading such a log that if they see something confusing it could be
a result of the heuristic not working fully.
2019-12-05 15:22:03 -08:00
Martin Atkins
30bf83cdeb helper/logging: Bring the LevelFilter into our own codebase
In order to make this work reasonably we can't avoid using some funny
heuristics, which are somewhat reasonable to apply within the context of
Terraform itself but would not be good to add to the general "logutils".

Specifically, this is adding the additional heuristic that lines starting
with spaces are continuation lines and so should inherit the log level
of the most recent non-continuation line.
2019-12-05 15:22:03 -08:00
James Bardin
ebc075226a update CHANGELOG.md 2019-12-05 18:11:54 -05:00
James Bardin
6817c844bc
Merge pull request #23559 from hashicorp/jbardin/deprecate-destroy-references
deprecation warning for destroy provisioner refs
2019-12-05 18:07:48 -05:00
James Bardin
4896052736
Merge pull request #23582 from hashicorp/jbardin/state-mv
Allow moving instances to new resources
2019-12-05 18:06:04 -05:00
Martin Atkins
73958499d1
Update CHANGELOG.md 2019-12-05 15:02:43 -08:00
Aaron Heesakkers
3dfeb67708 command/internal-plugin: Strip off TF_CLI_ARGS arguments
These are not meaningful for the `internal-plugin` subcommand, which is for internal use only.
2019-12-05 15:00:51 -08:00
James Bardin
a5cb36b34c Allow moving instances to new resources
If a state mv target happens to be a resource that doesn't exist, allow
the creation of the new resource inferring the EachMode from the target
address.
2019-12-05 17:38:52 -05:00
Pam Selle
2b8e876bdb Don't inspect an empty set, return false 2019-12-05 16:00:19 -05:00
Michele
7f738d3aff Add notarization details to changelog 2019-12-05 08:52:13 -08:00
Pam Selle
ba9cb786c3
Merge pull request #23546 from tmshn/dry-plan-color
make plan-diff format a bit more dry
2019-12-04 17:24:27 -05:00
Pam Selle
225e2ddc13
Update CHANGELOG.md 2019-12-04 17:02:35 -05:00
Pam Selle
89b1a0107c
Merge pull request #23561 from hashicorp/pselle/setMetaCleanup1
Update comment in SetResourceInstanceCurrent
2019-12-04 17:00:53 -05:00
Pam Selle
e4d2469698 Update comment 2019-12-04 12:08:34 -05:00
Pam Selle
2a2201cc74
Merge pull request #23475 from hashicorp/pselle/setMetaCleanup
Cleanup SetResourceInstanceCurrent to be clearer and more reliable
2019-12-04 12:04:12 -05:00
Kristin Laemmert
9891d0354a
providers: use addrs.Provider as map keys for provider.Factory (#23548)
* terraform/context: use new addrs.Provider as map key in provider factories
* added NewLegacyProviderType and LegacyString funcs to make it explicit that these are temporary placeholders

This PR introduces a new concept, provider fully-qualified name (FQN), encapsulated by the `addrs.Provider` struct.
2019-12-04 11:30:20 -05:00
James Bardin
8547603ff5 deprecation warning for destroy provisioner refs
Add deprecation warning for references from destroy provisioners or
their connections to external resources or values. In order to ensure
resource destruction can be completed correctly, destroy nodes must be
able to evaluate with only their instance state.

We have sufficient information to validate destroy-time provisioners
early on during the config loading process. Later on these can be
converted to hard errors, and only allow self, count.index, and each.key
in destroy provisioners. Limited the provisioner and block evaluation
scope later on is tricky, but if the references can never be loaded,
then they will never be encountered during evaluation.
2019-12-04 11:14:37 -05:00
Kyle MacDonald
26131d948c website: add yt video to /intro 2019-12-03 15:14:59 -08:00
Pam Selle
c5e6d36ace Revert "Confirmed these two tests are fine behavior manually running test case"
This reverts commit e8aa5bfdc9.
2019-12-03 16:52:29 -05:00
Pam Selle
de953eca6f Fixup for allowing empty lists/sets of resources 2019-12-03 16:29:01 -05:00
Pam Selle
19b408e053 Only need this one call, don't call the meta func 2019-12-03 14:27:18 -05:00
Pam Selle
61ce1cb3ad Fix provider related tests 2019-12-03 14:27:18 -05:00
Pam Selle
e8aa5bfdc9 Confirmed these two tests are fine behavior manually running test case 2019-12-03 14:27:18 -05:00
Pam Selle
01da7b4f7f Tested and confirmed we cannot delete this, so removed TODO 2019-12-03 14:27:18 -05:00
Pam Selle
87fdcd0064 Add a new method cause doing things in module is weird 2019-12-03 14:27:18 -05:00
Pam Selle
3b4382082d More comments and names 2019-12-03 14:27:18 -05:00
Pam Selle
fd34def9dc More comment updates, a lil refactor 2019-12-03 14:27:18 -05:00
Pam Selle
ca9da51516 Cleanup 2019-12-03 14:27:18 -05:00
Pam Selle
9482bb8eb0 Comment cleanup 2019-12-03 14:27:18 -05:00