Commit Graph

29572 Commits

Author SHA1 Message Date
Laura Pacilio
422b47618c Change name example to match new edits 2022-02-09 17:37:06 -05:00
Laura Pacilio
8be2c4a397 fix link 2022-02-09 14:30:02 -05:00
Laura Pacilio
faffa11e08 Update workspaces page 2022-02-09 14:21:46 -05:00
Laura Pacilio
ba0e2c1133 Update remote backend page to clarify workspace.name expression 2022-02-09 14:10:11 -05:00
Laura Pacilio
c1dc94a3d2
Merge pull request #30488 from hashicorp/update-console-docs
Update Console Command Documentation
2022-02-08 16:36:36 -05:00
Laura Pacilio
3c40dac0bc Fix according to PR comments 2022-02-08 16:22:44 -05:00
Craig Wright
3af6e82463
Merge pull request #30485 from salob/patch-1
Removing unnecessary comma from a single entry list example.
2022-02-08 11:59:44 -08:00
Laura Pacilio
b6dd327fd3
Merge pull request #30487 from hashicorp/update-depends-on-docs
Update depends_on documentation
2022-02-07 18:52:57 -05:00
Laura Pacilio
fe6092f325 Add line about how you can't use console during a run 2022-02-07 18:45:07 -05:00
Laura Pacilio
7eee8c674e Remove extra spaces 2022-02-07 18:16:16 -05:00
Laura Pacilio
879edcae72 wording changes 2022-02-07 18:09:07 -05:00
Alisdair McDiarmid
fe8183c4af json: Increment JSON plan format version
The JSON plan configuration data now includes a `full_name` field for
providers. This addition warrants a backwards compatible increment to
the version number.
2022-02-07 15:06:05 -05:00
Alisdair McDiarmid
ddc81a204f json: Disregard format version in tests
Instead of manually updating every JSON output test fixture when we
change the format version, disregard any differences when testing.
2022-02-07 15:05:58 -05:00
Alisdair McDiarmid
f5b90f84a8 jsonconfig: Improve provider configuration output
When rendering configuration as JSON, we have a single map of provider
configurations at the top level, since these are globally applicable.
Each resource has an opaque key into this map which points at the
configuration data for the provider.

This commit fixes two bugs in this implementation:

- Resources in non-root modules had an invalid provider config key,
  which meant that there was never a valid reference to the provider
  config block. These keys were prefixed with the local module name
  instead of the path to the module. This is now corrected.

- Modules with passed provider configs would point to either an empty
  provider config block or one which is not present at all. This has
  been fixed so that these resources point to the provider config block
  from the calling module (or wherever up the module tree it was
  originally defined).

We also add a "full_name" key-value pair to the provider config block,
with the entire fully-qualified provider name including hostname and
namespace.
2022-02-07 15:05:58 -05:00
Laura Pacilio
2a3b0f9c1e
Merge pull request #30017 from RubyElders/internal-contributing-docs
Update go test commands in .github/CONTRIBUTING.md.
2022-02-07 14:23:52 -05:00
Laura Pacilio
dbc143a043
Merge pull request #30484 from hashicorp/fix-preconditions
Preconditions and Postconditions - Quick Fixes
2022-02-07 13:19:24 -05:00
sian
d81335a55e
delete comma from single entry list 2022-02-07 18:12:26 +00:00
Laura Pacilio
6e399dfbe0 Update filename 2022-02-07 12:04:50 -05:00
Laura Pacilio
834f65e4f0 Fix formatting issues that would prevent website from loading 2022-02-07 11:59:28 -05:00
Ben Partridge
fa8a87fab5
Adds documentation to substr function to cover when length longer than input string
The `substr` function allows the `length` parameter to be longer than the remaining characters in the input after the offset. This is useful for when you want to truncate a string to a maximum number of characters. However, the documentation isn't clear on this so I had to do a test deployment to confirm the behaviour after finding the behaviour in an old issue https://github.com/hashicorp/terraform/issues/15751
2022-02-07 15:12:22 +11:00
Alisdair McDiarmid
d1ac8b71d4
Merge pull request #30471 from hashicorp/alisdair/what-even-is-validate
core: Remove unused PlanOpts.Validate
2022-02-04 08:21:09 -05:00
Alisdair McDiarmid
639eb5212f core: Remove unused PlanOpts.Validate
This vestigial field was written to but never read.
2022-02-03 14:16:25 -05:00
Alisdair McDiarmid
eea706aaef
Merge pull request #30462 from hashicorp/alisdair/preconditions-postconditions-self-references
configs: Validate pre/postcondition self-refs
2022-02-03 10:11:40 -05:00
Alisdair McDiarmid
7ded73f266 configs: Validate pre/postcondition self-refs
Preconditions and postconditions for resources and data sources may not
refer to the address of the containing resource or data source. This
commit adds a parse-time validation for this rule.
2022-02-03 09:37:22 -05:00
Alisdair McDiarmid
013170dd1b
Update CHANGELOG.md 2022-02-02 15:45:14 -05:00
Alisdair McDiarmid
0634c9437a
Merge pull request #30401 from hashicorp/f-preconditions-postconditions-rebased
Preconditions and Postconditions
2022-02-02 15:31:03 -05:00
Laura Pacilio
d3bc3a63dd
Merge pull request #30431 from hashicorp/replace-flag-clarifications
Make -replace flag clearer
2022-02-01 10:47:04 -05:00
Alisdair McDiarmid
cdae6d4396 core: Add context tests for pre/post conditions 2022-01-31 15:38:26 -05:00
Alisdair McDiarmid
a95ad997e1 core: Document postconditions as valid use of self
This is not currently gated by the experiment only because it is awkward
to do so in the context of evaluationStateData, which doesn't have any
concept of experiments at the moment.
2022-01-31 14:34:35 -05:00
Laura Pacilio
a794c80e0d final nits 2022-01-31 14:17:36 -05:00
Laura Pacilio
d14e04bf36 Fix notes according to PR feedback 2022-01-31 14:03:03 -05:00
Martin Atkins
f1b7f12f1c website: Initial draft docs for Preconditions and Postconditions 2022-01-31 14:02:53 -05:00
Martin Atkins
5573868cd0 core: Check pre- and postconditions for resources and output values
If the configuration contains preconditions and/or postconditions for any
objects, we'll check them during evaluation of those objects and generate
errors if any do not pass.

The handling of post-conditions is particularly interesting here because
we intentionally evaluate them _after_ we've committed our record of the
resulting side-effects to the state/plan, with the intent that future
plans against the same object will keep failing until the problem is
addressed either by changing the object so it would pass the precondition
or changing the precondition to accept the current object. That then
avoids the need for us to proactively taint managed resources whose
postconditions fail, as we would for provisioner failures: instead, we can
leave the resolution approach up to the user to decide.

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2022-01-31 14:02:53 -05:00
Laura Pacilio
a2f83ef7b6 Try to fix wording so it's clearer and more cohesive 2022-01-28 15:28:35 -05:00
Laura Pacilio
6e80276cc9 Remove invisible space 2022-01-28 14:44:56 -05:00
Martin Atkins
c827c049fe terraform: Precondition and postcondition blocks generate dependencies
If a resource or output value has a precondition or postcondition rule
then anything the condition depends on is a dependency of the object,
because the condition rules will be evaluated as part of visiting the
relevant graph node.
2022-01-28 11:00:29 -05:00
Martin Atkins
9076400436 configs: Decode preconditions and postconditions
This allows precondition and postcondition checks to be declared for
resources and output values as long as the preconditions_postconditions
experiment is enabled.

Terraform Core doesn't currently know anything about these features, so
as of this commit declaring them does nothing at all.
2022-01-28 11:00:29 -05:00
Martin Atkins
82c518209d experiments: New "preconditions_postconditions" experiment 2022-01-28 11:00:29 -05:00
Martin Atkins
4f41a0a1fe configs: Generalize "VariableValidation" as "CheckRule"
This construct of a block containing a condition and an error message will
be useful for other sorts of blocks defining expectations or contracts, so
we'll give it a more generic name in anticipation of it being used in
other situations.
2022-01-28 11:00:29 -05:00
Laura Pacilio
f56c7c1c85 Make language in callouts more user friendly 2022-01-27 17:05:45 -05:00
Laura Pacilio
dca94a9eaf fix verb tense 2022-01-27 16:58:17 -05:00
Laura Pacilio
aa3a046af3 final nits 2022-01-27 16:56:50 -05:00
Laura Pacilio
1a66861aaf A couple other tweaks 2022-01-27 16:53:25 -05:00
Laura Pacilio
238396567d Making replace flag clearer and making plan options clearer 2022-01-27 16:00:08 -05:00
Craig Wright
0900c7e0bb
Merge pull request #30397 from auroat/improve-docs
Improve the help.go docs: typo and a more explicit comment.

Merged after discussion with @apparentlymart.
2022-01-27 09:56:25 -08:00
Laura Pacilio
a855f04281
Merge pull request #30428 from hashicorp/fix-last-intro-nits
Fixing some final typos and nits
2022-01-27 10:52:30 -05:00
Alisdair McDiarmid
b8709d3690
Merge pull request #30421 from hashicorp/alisdair/plan-write-state-ordering
core: Fix plan write/state write ordering bug
2022-01-27 08:56:00 -05:00
Alisdair McDiarmid
64c7743793
Merge pull request #30408 from hashicorp/alisdair/pr-merge-changelog-reminder
Add merged pull request reminder 📎
2022-01-27 07:23:13 -05:00
Laura Pacilio
6a02fbaef3 Fixing some final typos and nits that robin found! 2022-01-26 20:06:49 -05:00
Craig Wright
ca02b55fba
Merge pull request #30409 from tyron/fix-module-outputs-reference
Fix reference to child module in outputs docs
2022-01-26 15:47:42 -08:00