Commit Graph

26996 Commits

Author SHA1 Message Date
James Bardin 5e13d57f4e
Merge pull request #26463 from hashicorp/kt/azurerm-secret-backend-fix
AzureRM backend: correctly lookup environment from metadata host
2020-10-05 14:26:32 -04:00
Pam Selle 112b0b98af
Merge pull request #26483 from nexxai/patch-1
[Documentation] Typo fixes
2020-10-05 13:38:38 -04:00
Pam Selle 1b29be2356
Merge pull request #26485 from hashicorp/pselle/sensitive-var-console
Obfuscate sensitive vals in console
2020-10-05 13:37:53 -04:00
Pam Selle 6440c83947 Move marked check above null check 2020-10-05 13:29:51 -04:00
Pam Selle c57ca152e6 Obfuscate sensitive vals in console
Updates terraform console to show "(sensitive)"
when a value is marked as sensitive.
2020-10-05 13:16:34 -04:00
Alisdair McDiarmid fd4497d48d
Update CHANGELOG.md 2020-10-05 13:12:32 -04:00
Alisdair McDiarmid 35d4926bf7
Merge pull request #25837 from remilapeyre/consul-force-unlock
Fix `terraform force-unlock <lock_id>` for Consul backend
2020-10-05 13:11:08 -04:00
JT Smith 6ac8bfb86d
[Documentation] Typo fixes
Just re-read the docs the ignore_changes update and saw a few typos
2020-10-05 10:10:38 -06:00
James Bardin ee564a5ceb
Merge pull request #26421 from hashicorp/jbardin/ignore-changes-map
allow ignore_changes to reference any map key
2020-10-05 12:06:05 -04:00
James Bardin 0c72c6f144 s/FullDestroy/IsFullDdestroy/ 2020-10-05 10:50:25 -04:00
James Bardin e35524c7f0 use existing State rather than Change.Before
The change was passed into the provisioner node because the normal
NodeApplyableResourceInstance overwrites the prior state with the new
state. This however doesn't matter here, because the resource destroy
node does not do this. Also, even if the updated state were to be used
for some reason with a create provisioner, it would be the correct state
to use at that point.
2020-10-05 10:40:14 -04:00
James Bardin a1181adca4 remove unused method stub 2020-10-05 10:35:31 -04:00
Kristin Laemmert 367c82c5ae
Update CHANGELOG.md 2020-10-05 08:49:57 -04:00
OwenTuz bb39fafbe5
lang/funcs: lookup() will only treat map as unknown if it is wholly unknown (#26427)
Fix for issue #26320 - this allows us to derive known values from
partially known maps where we can, and may prevent unnecessary
destroy/rebuild cycles during apply in some cases.
2020-10-05 08:48:49 -04:00
Kristin Laemmert 3933cbd491
remove LegacyProvider (#26433) 2020-10-05 08:33:49 -04:00
nisunisu 911d09d877 Fixed a typo 2020-10-04 22:11:45 +09:00
Rémi Lapeyre 42be5854a2 Properly quote schema_name in the pg backend configuration 2020-10-03 18:02:13 +02:00
Pam Selle 69b03ebf42
Merge pull request #26379 from hashicorp/pselle/sensitive-nested-block-support
Support sensitivity within nested blocks
2020-10-02 17:28:15 -04:00
Martin Atkins 593cf7b4d5 didyoumean: move from "helper" to "internal"
This new-ish package ended up under "helper" during the 0.12 cycle for
want of some other place to put it, but in retrospect that was an odd
choice because the "helper/" tree is otherwise a bunch of legacy code from
when the SDK lived in this repository.

Here we move it over into the "internal" directory just to distance it
from the guidance of not using "helper/" packages in new projects;
didyoumean is a package we actively use as part of error message hints.
2020-10-02 13:35:07 -07:00
Pam Selle 111aadd0f0 Extend tests further 2020-10-02 15:01:17 -04:00
Pam Selle 55c96da27e Move nested block printing to own method for readability 2020-10-02 14:56:50 -04:00
Nick Fagerlund 26f786959b
website: Update all Learn crosslinks (#26442)
* website: Update all Learn crosslinks

The URL structure on Learn recently changed, so it's time to update some URLs.

Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
2020-10-02 11:02:59 -07:00
James Bardin 32681190ca
Merge pull request #26458 from hashicorp/jbardin/data-ref-index
data sources with indexed references to managed resources
2020-10-02 13:27:28 -04:00
Pam Selle 2ec95f1abc Make an after val unknown to exercise the known check 2020-10-02 13:11:55 -04:00
Pam Selle f35b530837 Update compatibility checks for blocks to not use marks
Remove marks for object compatibility tests to allow apply
to continue. Adds a block to the test provider to use
in testing, and extends the sensitivity apply test to include a block
2020-10-02 13:11:55 -04:00
Pam Selle 73b1d8b0d1 Add special diff for nested blocks
When a value in a nested block is marked as sensitive,
it will result in the behavior of every member of
that block being sensitive. As such, show a
specialized diff that reduces noise of (sensitive)
for many attributes that we won't show. Also update
the warning to differentiate between showing a warning
for an attribute or warning for blocks.
2020-10-02 13:11:55 -04:00
Pam Selle 6617c2729c Test additions for nested blocks
Add some coverage for in-place on nested block

Add nested block to deletion test
2020-10-02 13:04:54 -04:00
Pam Selle 3e7be13dff Update ordering for marking/unmarking and asserting plan valid
Update when we unmark objects so we can assert the plan is valid,
and process UnknownAsNull on the unmarked value
2020-10-02 13:03:11 -04:00
Pam Selle 26f77564d7
Merge pull request #26459 from hashicorp/pselle/sensitive-vals-map
Add format/diff coverage for maps with sensitivity
2020-10-02 13:00:00 -04:00
James Bardin 95197f0324 use EvalSelfBlock for destroy provisioners
Evaluate destroy provisioner configurations using only the last resource
state value, and the static instance key data.
2020-10-02 12:38:51 -04:00
James Bardin 804449eda1
Merge pull request #26461 from hashicorp/jbardin/refresh-false
always load instance state when -refresh=false
2020-10-02 12:08:10 -04:00
Martin Atkins 6b5ca49578 helper: remove a bunch of unused packages, types and functions
With the SDK moving out into its own repository, a lot of the packages
under "helper/" are no longer needed. We still need to keep around just
enough legacy SDK to support the "test" provider and some little bits and
bobs in the backends and provisioners, but a lot of this is now just dead
code.

One of the test provider tests was depending on some validation functions
only because the schema in there was originally copied from a "real"
provider. The validation rules are not actually important for the test,
so I removed them. Otherwise, this removes only dead code.
2020-10-02 09:01:37 -07:00
James Bardin 64c3a8f550 lang.Scope.EvalSelfBlock
In order to properly evaluate a destroy provisioner, we cannot rely on
the usual evaluation context, because the resource has already been
removed from the state.

EvalSelfBlock evaluates an hcl.Body in the limited scope of a single
object as "self", with the added values of "count.index" and "each.key".
2020-10-02 11:25:21 -04:00
Pam Selle 1817c8ac3c
Merge pull request #26412 from OwenTuz/issue-26411-fix-failing-e2e-test-provider-not-found
Fix bad string match that was causing TestInitProviderNotFound to fail
2020-10-02 10:43:18 -04:00
Pam Selle 5286a1bfb7
Merge pull request #26466 from jerrychong25/patch-2
Modified terraform force-unlock command
2020-10-02 10:33:17 -04:00
James Bardin 43c0525277 fix the test that was supposed to break
The test for this behavior did not work, because the old mock diff
function does not work correctly. Write a PlanResourceChange function to
return a correct plan.
2020-10-02 08:50:24 -04:00
Jerry Chong 90cbc5a123
Modified terraform force-unlock command
-Added code block for terraform force-unlock LOCK_ID
2020-10-02 09:42:55 +08:00
kt b66364f7aa
AzureRM backend: correctly lookup environment from metadata host 2020-10-01 16:34:51 -07:00
James Bardin 07af1c6225 destroy time eval of resources pending deletion
Allow the evaluation of resource pending deleting only during a full
destroy. With this change we can ensure deposed instances are not
evaluated under normal circumstances, but can be references when needed.
This also allows us to remove the fixup transformer that added
connections so temporary values would evaluate in the correct order when
referencing destroy nodes.

In the majority of cases, we do not want to evaluate resources that are
pending deletion since configuration references only can refer to
resources that is intended to be managed by the configuration. An
exception to that rule is when Terraform is performing a full `destroy`
operation, and providers need to evaluate existing resources for their
configuration.
2020-10-01 17:11:46 -04:00
James Bardin fa8f8df7b6 add ChangesSync.FullDestroy
In order to handle various edge cases during a full destroy, add
FullDestroy to the synchronized changes so we can attempt to deduce if
the plan was created from `terraform destroy`.

It's possible that the plan was created by removing all resourced from
the configuration, but in that case the end result is the same. Any of
the edge cases with provider or destroy provisioner configurations would
not apply, since there would not be any configuration references to
resolve.
2020-10-01 17:08:25 -04:00
James Bardin ac526d8d5d always load instance state when -refresh=false
The loading of the initial instance state was inadvertently skipped when
-refresh=false, causing all resources to appear to be missing from the
state during plan.
2020-10-01 16:04:35 -04:00
Pam Selle 52b6f7f53e Move common IsMarked checks above switch statement 2020-10-01 14:34:44 -04:00
Pam Selle 1780351636 If the whole map is marked, have the same sensitivity behavior as a single value 2020-10-01 14:30:33 -04:00
Pam Selle 0520f143a2 Add diff coverage for maps
Considers wholly marked maps as well
as map keys
2020-10-01 14:18:40 -04:00
James Bardin 78322d5843 data depends_on with indexed references
If a data source refers to a indexed managed resource, we need to
re-target that reference to the containing resource for planning.  Since
data sources use the same mechanism as depends_on for managed resource
references, they can only refer to resources as a whole.
2020-10-01 14:10:09 -04:00
Pam Selle a7e43dfd46
Merge pull request #26431 from hashicorp/pselle/sensitive-vals-docs
docs: Docs for sensitive variables
2020-10-01 13:50:11 -04:00
Pam Selle 3ddbb4b009 Update provider caveat grammar 2020-10-01 13:19:14 -04:00
Pam Selle 93d38ff2d2 Update intro to code blocks 2020-10-01 13:16:15 -04:00
Pam Selle be50089c7f Rephrase sensitive index description 2020-10-01 13:12:25 -04:00
Pam Selle 09551de078 Rewrite intro to section, rename section, move state info
Move the information about state from the "caveats" to the main
info section, using similar information to sensitive outputs.
Updates the header of the section from similar inspiration.
2020-10-01 13:09:52 -04:00