Commit Graph

27938 Commits

Author SHA1 Message Date
Pam Selle e5274f9e89
Merge pull request #27835 from hashicorp/pselle/warn-interpolation
Remove interpolation-only warning
2021-02-19 16:13:32 -05:00
Alisdair McDiarmid 02eb283ad4 backend/remote: Fix broken state lock retry
When using the -lock-timeout option with the remote backend configured
in local operations mode, Terraform would fail to retry acquiring the
lock. This was caused by the lock error message having a missing Info
field, which the state manager requires to be present in order to
attempt retries.
2021-02-19 15:47:18 -05:00
Oliver Ford 2f7c368d91
Document `inline` & `on_failure` behaviour
cf. #27554
2021-02-19 17:56:48 +00:00
James Bardin 6871d0c991 update CHANGELOG.md 2021-02-19 11:29:38 -05:00
Pam Selle fa7c3d7e10 Remove interpolation-only warning
These interpolations are removed when upgrading using 0.12upgrade,
and are removed in terraform fmt in many cases
2021-02-19 10:59:09 -05:00
James Bardin dd5227a3be provider transformer tests
remove some boilerplate when setting up tests
2021-02-19 10:56:55 -05:00
James Bardin 8c1703d8df simplify the use of configuration_aliases
Now that the possibility of extra provider nodes being added is gone, we
can skip the separate handling of configuration_aliases in the
ProviderConfigTransformer. Instead of adding concrete provider nodes for
configuration_aliases (which could be surprising later as the code
evolves), we implicitly add them based on the providers being passed in
by the parent module, using the same mechanism as non-aliased providers.

We can know that the `providers` map will be populated, because the
provider structures are validated while loading the configuration.
2021-02-19 10:56:55 -05:00
James Bardin b1d8d856ca remove ParentProviderTransformer
There is no longer any concept of a "parent provider". Inheritance of
default providers is discovered and connected in the ProviderTransformer
itself.
2021-02-19 10:56:55 -05:00
Pam Selle 230658f2b2 Upgrade ignore_changes wildcard from warning to error
The syntax ignore_changes = ["*"] was deprecated and now errors.
Use = all instead.
2021-02-19 10:34:20 -05:00
James Bardin 3da5d2bdf6
Merge pull request #27692 from alexwlchan/abolish-the-heirarchy
Correct the spelling of heirarchy/hierarchy throughout
2021-02-18 16:34:28 -05:00
Pam Selle 28d3505241
Merge pull request #27823 from hashicorp/pselle/upgrade-tool-testfixtures
Remove 0.13upgrade test fixtures
2021-02-18 14:39:24 -05:00
Pam Selle b3c2f715e9
Merge pull request #27821 from hashicorp/pselle/internal-helper-schema
Remove readme from internal helper/schema package
2021-02-18 14:39:06 -05:00
Pam Selle 156b1615a2 Remove 0.13upgrade test fixtures 2021-02-18 12:57:58 -05:00
Pam Selle 84696eae33
Merge pull request #27816 from jessicastenning/fix-docs-grammatical-mistake
Fix sentence in v0.14 upgrade guide
2021-02-18 12:37:53 -05:00
Pam Selle e1c25337c7 Delete readme, add doc.go to helper/schema
Remove the README that had old user-facing information, replacing
it with a doc.go that describes the package and points to the
plugin SDK for external consumers.
2021-02-18 12:30:10 -05:00
Alisdair McDiarmid 7f8b8a9046
Merge pull request #27808 from hashicorp/alisdair/command-views-operation-view
backend/local: Replace CLI with view instance
2021-02-18 12:14:33 -05:00
Alisdair McDiarmid 68558ccd54 backend/local: Replace CLI with view instance
This commit extracts the remaining UI logic from the local backend,
and removes access to the direct CLI output. This is replaced with an
instance of a `views.Operation` interface, which codifies the current
requirements for the local backend to interact with the user.

The exception to this at present is interactivity: approving a plan
still depends on the `UIIn` field for the backend. This is out of scope
for this commit and can be revisited separately, at which time the
`UIOut` field can also be removed.

Changes in support of this:

- Some instances of direct error output have been replaced with
  diagnostics, most notably in the emergency state backup handler. This
  requires reformatting the error messages to allow the diagnostic
  renderer to line-wrap them;
- The "in-automation" logic has moved out of the backend and into the
  view implementation;
- The plan, apply, refresh, and import commands instantiate a view and
  set it on the `backend.Operation` struct, as these are the only code
  paths which call the `local.Operation()` method that requires it;
- The show command requires the plan rendering code which is now in the
  views package, so there is a stub implementation of a `views.Show`
  interface there.

Other refactoring work in support of migrating these commands to the
common views code structure will come in follow-up PRs, at which point
we will be able to remove the UI instances from the unit tests for those
commands.
2021-02-18 12:08:08 -05:00
James Bardin 0da0b24527 provider transformer test mixing legacy stuff
Test a combination of new required_providers modules and legacy implied
providers along with providers within modules and inheritance.
2021-02-18 11:47:11 -05:00
Alisdair McDiarmid c0b22007fc
Merge pull request #27818 from hashicorp/alisdair/unmark-provisioner-config
core: Unmark provisioner config before validation
2021-02-18 11:27:59 -05:00
Pam Selle 9de4f472f6
Update CHANGELOG.md 2021-02-18 11:15:10 -05:00
Pam Selle 1b534eed6b
Update CHANGELOG.md 2021-02-18 11:14:27 -05:00
Pam Selle 8d2fbd4cd8
Remove deprecation on undeclared variable, docs, and summary adjustment (#27795)
* Remove deprecation on undeclared variable

Remove deprecation and add docs specific to the behavior around
undeclared variable values

* Limit full warnings to 2 instances, then summary

This way, the third warning is a summary, rather than the fourth
warning being the summary
2021-02-18 11:11:52 -05:00
Alisdair McDiarmid 3f017b4413 core: Unmark provisioner config before validation
Sensitive values in provisioner configuration would cause errors in the
validate phase. We need to unmark these value before serializing the
config value for the provisioner plugin.
2021-02-18 10:41:43 -05:00
James Bardin e417d796a0 don't add duplicate proxy provider nodes
Fix the logic to add proxy provider nodes for implicitly passed in
providers. The missing continue allowed multiple nodes satisfying the
same provider address to be added to the graph. When attaching the
providers to resources, the fist one encountered would be used, which
could change each time the graph was built.
2021-02-18 10:17:56 -05:00
Kristin Laemmert f6505870cc
Mildwonkey/providers interface renaming (#27805)
* providers.Interface: huge renamification

This commit renames a handful of functions in the providers.Interface to
match changes made in protocol v6. The following commit implements this
change across the rest of the codebase; I put this in a separate commit
for ease of reviewing and will squash these together when merging.

One noteworthy detail: protocol v6 removes the config from the
ValidateProviderConfigResponse, since it's never been used. I chose to
leave that in place in the interface until we deprecate support for
protocol v5 entirely.

Note that none of these changes impact current providers using protocol
v5; the protocol is unchanged. Only the translation layer between the
proto and terraform have changed.
2021-02-18 10:13:43 -05:00
Jessica Stenning 24e7a5596b Fix sentence in v0.14 upgrade guide 2021-02-18 14:34:04 +00:00
Kristin Laemmert 2b4e389839
Mildwonkey/nested type format (#27793)
* command/format: check for sensitive NestedTypes

Eventually, the diff formatter will need to be updated to properly
handle NestedTypes, but for now we can let the existing function deal
with them as regular cty.Object-type attributes.

To avoid printing sensitive nested attributes, we will treat any
attribute with at least one sensitive nested attribute as an entirely
sensitive attribute.

* bugfix for Object ImpliedType()

ImpliedType() was returning too early when the given object had optional
attributes, therefore skipping the incredibly important step of
accounting for the nesting mode when returning said type.
2021-02-18 08:48:52 -05:00
Alisdair McDiarmid 1d0414a63a
Merge pull request #27813 from hashicorp/paddy_empty_diags
Test empty diagnostics.
2021-02-18 08:22:10 -05:00
Paddy Carver 6c57395ef3 Test empty diagnostics.
Add a test for a diagnostic with no steps to make sure it still gets
associated with the resource in the config. Follow up to #27710 using
@alisdair's suggested testing.
2021-02-18 02:08:10 -08:00
Matthew Frahry 31387d2a0b
Update changelog for #26561 2021-02-17 15:15:55 -08:00
Matthew Frahry 85b9bdea96
backend/azure: azure state refreshes outside of grabbing the lock #26561 2021-02-17 15:14:47 -08:00
Pam Selle 48bfde2e28
Merge pull request #27798 from hashicorp/pselle/upgrade_command_removal
Remove removed `upgrade` commands
2021-02-17 14:42:33 -05:00
Pam Selle 08b649b6f9 Remove removed upgrade commands
Delete commands that are no longer in Terraform and have been
removed for a full release cycle.
2021-02-17 14:34:58 -05:00
James Bardin 04b5c7d452
Merge pull request #27800 from amslezak/patch-1
sentence refactor - consistently -> consistency
2021-02-17 09:02:20 -05:00
James Bardin 2b1dc1ef0d
Merge pull request #27517 from njuCZ/fix_functions_tc
fix test case on windows
2021-02-17 09:00:07 -05:00
James Bardin b0094dbf36
Merge pull request #27678 from GreenHedgehog/master
Fix possible nil pointer dereference in azure sdk
2021-02-17 08:49:49 -05:00
Matthew Frahry d89c8f5dcf
Update changelog for #26721 2021-02-16 23:27:09 -08:00
Matthew Frahry 81dc028689
backend/azurerm: updating the dependencies for the Azure Backend #26721 2021-02-16 23:24:56 -08:00
Andy Slezak 0639054683
sentence refactor - consistently -> consistency 2021-02-16 18:29:31 -05:00
Pam Selle d390fad487
Merge pull request #27799 from hashicorp/pselle/fix_test
[tests] Remove duplicate declaration
2021-02-16 18:17:11 -05:00
Pam Selle b582b19359 Remove duplicate declaration 2021-02-16 18:08:36 -05:00
Alisdair McDiarmid 6375c6ce6b
Merge pull request #27787 from hashicorp/alisdair/command-views-state-locker
clistate: Update clistate.Locker for command views
2021-02-16 17:37:18 -05:00
James Bardin 5b36b37b82
Merge pull request #27758 from hashicorp/jbardin/configuration_aliases-docs
update docs for configuration_aliases
2021-02-16 17:35:24 -05:00
Alisdair McDiarmid bfe791d074
Update CHANGELOG.md 2021-02-16 17:28:20 -05:00
Alisdair McDiarmid f7dbb1ab33
Merge pull request #27796 from hashicorp/alisdair/fix-missing-deposed-key-preapply
terraform: Fix missing deposed key for PreApply
2021-02-16 17:26:24 -05:00
Alisdair McDiarmid 8fb319bc79
Merge pull request #27790 from hashicorp/alisdair/ui-hook-miscolored
cli: Fix misapplied terminal colors on run logs
2021-02-16 17:15:53 -05:00
Alisdair McDiarmid f1a292652d terraform: Fix missing deposed key for PreApply
The PreApply hook was always being called with a nil generation
argument, instead of the deposed key of the resource (if present). This
commit passes the deposed key from the change to the PreApply hook, and
adds a context test to cover this.
2021-02-16 17:14:52 -05:00
James Bardin 0d63b3ec24
Merge pull request #27791 from hashicorp/jbardin/test-conformance-dynamic
reverse call to TestConformance in objchange
2021-02-16 15:42:12 -05:00
Alisdair McDiarmid 0aa227e0e3 cli: Fix misapplied terminal colors on run logs
Due to calling the Colorize function with the full string instead of the
format string, plan/apply logs which include resource instance keys or
IDs which happen to match color formatting would be rendered
incorrectly.

This commit fixes this by only colorizing the known-safe format string.
We also add full test coverage for the UI hook, although only one of the
hooks is tested for this color bugfix due to verbosity of the test.

We also add the bold coloring to the provisioner output prefix, which
seems to have been an oversight.
2021-02-16 15:05:22 -05:00
Kristin Laemmert 7943312ebd
Merge pull request #27699 from hashicorp/mildwonkey/protocolv6
Mildwonkey/protocolv6
2021-02-16 14:51:53 -05:00