Commit Graph

21250 Commits

Author SHA1 Message Date
Martin Atkins 57db3cfe51 website: 0.11 upgrade guidance on resources with count = 0
This is a genre of invalid output expression that we've seen quite
commonly while testing with 0.11.0-rc1, so we'll call it out specifically
in the upgrade guide and suggest how to fix it.
2017-11-16 10:23:18 -08:00
Martin Atkins f3f0b5356e website: specify HCL syntax highlighting in the 0.11 upgrade guide 2017-11-16 10:23:18 -08:00
Martin Atkins 31ee29050e
website: US English spelling of "honor" 2017-11-15 09:09:47 -08:00
Martin Atkins 1da2464e72 website: further copyediting for "Providers within Modules"
The differences between the implicit and explicit modes of passing
provider configurations between modules are significant enough to warrant
giving these approaches different names and describing them separately.

This also includes documentation of the current limitation discussed in
#16612, where explicit passing requires a proxy configuration block even
for a _default_ provider configuration, because that limitation is being
accepted for the 0.11.0 release to limit scope.
2017-11-15 08:50:49 -08:00
Paul Banks 2889eded3f
Tweaks to Registry Docs for 0.11 (#16663)
* Registry 0.11 doc tweaks

* Add changes for v0.11
2017-11-15 16:27:41 +00:00
Martin Atkins 275ab4a74e main: don't print the CLI config into the logs
Now that we're expecting "credentials" blocks in the config (with auth
tokens for private module registries, etc) we should not print out the
config contents into the log, or else people will probably end up
accidentally disclosing their credentials when sharing debug output with
us, or will be reluctant to share debug output.
2017-11-14 15:49:26 -08:00
James Bardin aa44e9d56b
Merge pull request #16650 from hashicorp/jbardin/removed-implicit-provider
normalize missing provider names
2017-11-14 18:00:45 -05:00
James Bardin 29264df7c0 normalize missing provider names
The provider name coming from ProvidedBy may be resolved if it only
exists in the state. Make sure to strip the module and provider
prefixes for the provider name when adding missing providers.
2017-11-14 15:53:37 -05:00
James Bardin 105b66e74d error out when a referenced provider is missing 2017-11-13 20:41:38 -05:00
James Bardin b9b418bcb0 test passing in implicitly used provider 2017-11-13 20:41:38 -05:00
James Bardin 8bf270daa9 rewrite the ProviderConfigTransformer
It's become apparent that passing in a provider config for an implicitly
used provider would be very useful. While the ProviderConfigTransformer
efficiently added providers to the graph, the algorithm was reversed
from what would be needed to allow overriding implicit providers.

Change the ProviderConfigTransformer to fist add all configured
provider, even if they are empty stubs. Then run through all providers
being passed in from the parent, and replace the provider nodes we
created with proxies, and add implicit proxies where none existed. The
extra nodes will then be pruned later.
2017-11-13 20:41:38 -05:00
James Bardin aef082d1ec
Merge pull request #16621 from hashicorp/jbardin/provider-panic
Fix panic with invalid module providers
2017-11-13 19:27:19 -05:00
James Bardin b357c02ad1 don't panic 2017-11-10 11:01:32 -05:00
James Bardin 8619f566bb validate providers passed to a module exist
This validation was lost in the migration of inheritance back to core.
Make sure a module configuraton doesn't specifiy a provider that doesn't
exist.
2017-11-10 11:01:32 -05:00
Clint f15d95fc4d
Update CHANGELOG.md 2017-11-10 08:25:54 -06:00
James Bardin 95ad20e360 release: clean up after v0.11.0-rc1 2017-11-09 20:10:58 +00:00
James Bardin 9389013011
v0.11.0-rc1 2017-11-09 19:49:01 +00:00
Martin Atkins 071e746edf website: use correct style for providers map in upgrade guide
We don't generally use comma separators for map elements in HCL, because
the newline implies it.
2017-11-09 11:23:24 -08:00
Martin Atkins 1622a63da5 website: use correct syntax for providers map in upgrade guide
This was using JSON-style syntax rather than HCL-style.
2017-11-09 11:22:34 -08:00
Martin Atkins 11790442a1 website: Describe provider config hoisting in 0.11 upgrade guide
We are recommending that as of 0.11 all provider configurations be placed
in the root module and, where necessary, be explicitly passed down via
a providers map to customize which configurations are seen by each
child module.

This new section attempts to guide users through such refactoring in the
common case where a child module defines its own provider configuration
based on a value passed in an input variable, and then uses that as
some context to link to the more detailed docs to help those who have
more complex configurations.
2017-11-09 11:08:09 -08:00
Martin Atkins 40b7b4c133 website: Further clarification on how providers and modules interact
The initial pass of this section had some remaining ambiguities, so this
is a second revision that attempts to use terminology more consistently
and to not some additional behaviors that were not described in the
initial version.
2017-11-09 11:08:09 -08:00
Martin Atkins f3a2165587 website: Use "Input Variable" as full term for var.foo
We've historically been somewhat inconsistent in how we refer to the
type of object defined by "variable" blocks in configuration. Parts of
our documentation refer to them as "input variables" or just "variables",
while our implementation refers to them as "user variables".

Since Terraform Registry is now also referring to these as "Inputs", here
we standardize on "Input Variable" as the fully-qualified name for this
concept, with "variable" being a shorthand for this where context is
obvious. Outside of this context, anything that can be referred to in
an interpolation expression is generically known as a "variable", with
Input Variables being just one kind, specified by the "var." prefix.

While this terminology shift is not critical yet, it will become more
important as we start to document the new version of the configuration
language so we can use the generic meaning of "variable" there.
2017-11-09 11:08:09 -08:00
Martin Atkins 3d33a36bf6 website: update terminology used in provider config docs
The bulk of the text on this page hasn't been revised for some time and
so parts of it were using non-idiomatic terminology or not defining terms
at all.

The main goal of this revision is to standardize on the following terms:

- "provider configuration" refers to a specific provider block in config,
  as a distinct idea from the provider _itself_, which is a singleton.

- "Default" vs. "additional" provider configurations, distinguishing
  those without and with "alias" arguments respectively. These are named
  here so that we can use this terminology to describe the different
  behaviors of each for the purposes of provider inheritance between
  modules.
2017-11-09 11:08:09 -08:00
James Bardin ca191a3b2f
Merge pull request #16599 from hashicorp/jbardin/orphaned-module-outputs
Remove modules and module outputs from state
2017-11-09 12:33:35 -05:00
James Bardin e3ea3150ae make NodeOutputOrphan referenceable
The removed output need to be referencable so if its parent module is
also being remove, the removal happens in the correct order.
2017-11-09 10:52:46 -05:00
James Bardin e0ad3300c6 fix References used by the ReferenceTransformer
There was a bug where all references would be discarded in the case when
a self-reference was encountered. Since a module references all
descendants by it's own path, it returns a self-reference by definition.
2017-11-09 10:36:42 -05:00
James Bardin 7e4dcdb9f0 run RemovedModuleTransformer before References
Also add RemovedModuleTransformer to the plan graph for parity.
2017-11-09 10:34:56 -05:00
James Bardin 3916f3a5a3 only add nodes in RemovedModuleTransformer
Let the ReferenceTransformer connect them once it's fixed.
2017-11-09 10:32:01 -05:00
James Bardin 5915d883d2 make NodeModuleRemoved a GraphNodeReferencer
This was the node can be automatically connected by the
ReferenceTransformer.
2017-11-09 10:30:55 -05:00
James Bardin 14cc654b16 preserve order when removing module from state 2017-11-08 22:12:35 -05:00
James Bardin ccc9b1d767 replacing orphaned with removed 2017-11-08 22:10:43 -05:00
Martin Atkins 4cde21501c core: more explanation when a provider block cannot be found
Our new resource-to-provider matching is stricter about explicitly
matching aliases when config is present (no longer automatically
inherited) and with locating providers to destroy removed resources.

With this in mind, this is an attempt to expand slightly on this error
message now that users are more likely to see it.

In future it would be nice to do some explicit validation of this a bit
closer to the UI, so we can have room for more explanatory text, but this
additional messaging is intended to help users understand why they might
be seeing this message after removing a provider configuration block from
configuration, whether directly or as a side-effect of removing a module.
2017-11-08 17:00:35 -08:00
James Bardin 15ea04af8a remove modules from state
Remove the module entry from the state if a module is no longer in the
configuration. Modules are not removed if there are any existing
resources with the module path as a prefix. The only time this should be
the case is if a module was removed in the config, but the apply didn't
target that module.

Create a NodeModuleRemoved and an associated EvalDeleteModule to track
the module in the graph then remove it from the state. The
NodeModuleRemoved dependencies are simply any other node which contains
the module path as a prefix in its path.

This could have probably been done much easier as a step in pruning the
state, but modules are going to have to be promoted to full graph nodes
anyway in order to support count.
2017-11-08 19:11:53 -05:00
Martin Atkins 1750f03df9
Update CHANGELOG.md 2017-11-08 12:03:25 -08:00
James Bardin aa2bd0945b properly find orphaned outputs
You can't find orphans by walking the config, because by definition
orphans aren't in the config.

Leaving the broken test for when empty modules are removed from the
state as well.
2017-11-08 14:28:02 -05:00
James Bardin 9283568dca add OrphanOutputTransformer to the plan graph
make sure orphaned outputs appear in the plan as well
2017-11-08 14:28:02 -05:00
James Bardin 68b07a766a add failing test for orphaned modules outputs
When an entire module is removed from the config, that module's outputs
are not removed from the state.
2017-11-08 14:28:02 -05:00
James Bardin 00b7715710
Merge pull request #16586 from hashicorp/jbardin/providers
Store resolved providers in state
2017-11-08 14:27:48 -05:00
Martin Atkins 6722b7bbdc
Update CHANGELOG.md 2017-11-08 11:25:38 -08:00
Nic Cope 27ba7de77d backend/gcs: automatically add trailing slash to prefix
The backend doesn't function correctly if a trailing slash is not present, due to how workspaces are enumerated.
2017-11-08 11:24:36 -08:00
Radek Simko 2974d63e75
Merge pull request #16588 from hashicorp/f-panic-on-invalid-rd-set
helper/schema: Opt-in panic on invalid ResourceData.Set
2017-11-08 19:17:46 +00:00
Nándor István Krácser e5cc8af7f3 helper/resource: fix ungrammatical doc comment in StateChangeConf 2017-11-08 09:43:36 -08:00
Radek Simko e93d64b18c
helper/schema: Opt-in panic on invalid ResourceData.Set 2017-11-08 10:05:11 +00:00
James Bardin b8b7548614 remove module referencing existing provider 2017-11-07 22:05:52 -05:00
James Bardin 3801ca5bbf test that Refresh updates Provider fields in state 2017-11-07 21:42:30 -05:00
James Bardin 09180a10ff cannot destroy without a config 2017-11-07 21:23:37 -05:00
James Bardin d62e9217ae update test state strings for backend/local 2017-11-07 21:23:10 -05:00
James Bardin 3c807e5427 update state test strings in command package 2017-11-07 21:18:08 -05:00
James Bardin d613959cda write provider to state for import nodes
and update the test state strings
2017-11-07 21:05:37 -05:00
James Bardin 3977fe8b2d write provider to state for refresh nodes
and update the test state strings
2017-11-07 21:05:28 -05:00