Commit Graph

30399 Commits

Author SHA1 Message Date
Laura Pacilio
b9eb263744
Merge pull request #31788 from hashicorp/remove-provisioners
Remove legacy provisioners from docs
2022-09-14 19:28:29 -04:00
Laura Pacilio
ee61929a9c update note on provisioners page 2022-09-14 18:51:43 -04:00
Laura Pacilio
a891119b61 Remove legacy provisioners from docs 2022-09-14 18:43:48 -04:00
Martin Atkins
a30294372f website: Version-specific upgrade guides (v1.4 branch)
Before our website allowed selecting from older versions of Terraform to
see older documentation we needed to preserve all of the historical
upgrade guides in the latest release branch so that they'd stay available
on the website.

However, our new strategy is for each release to have its own separate
set of documentation selectable using a global version selector. We should
therefore now have only the upgrade guide for the each minor release
on its release branch, with the upgrade guides for earlier releases
instead maintained on their own branches.

However, our v1.1 branch is, as a matter of pragmatism, serving as the home
for the "v1.1 and earlier" documentation, and so there will continue to
be multiple upgrade guides on that branch. For that reason, we're
preserving the URL scheme "upgrade-guides" (plural) even though the URL
now points to only a single version upgrade guide because that causes
readers to land in the correct place if they are on a modern version's
upgrade guide page and they use the version selector to choose the
"v1.1 and earlier" option.
2022-09-14 13:37:04 -07:00
James Bardin
3062d43b39 update go1.19.1 2022-09-14 13:37:33 -04:00
Laura Pacilio
488bbd80fc
Merge pull request #31484 from hashicorp/update-cloud-block-pages
Update Cloud Block Docs
2022-09-09 15:47:35 -04:00
Laura Pacilio
039f884df9
Merge pull request #31547 from hashicorp/clarify-backend-state-storage
Add more context about local backend configuration state file
2022-09-09 15:45:32 -04:00
megan07
629b6dc64a
Merge pull request #31733 from hashicorp/megan_pr_touch_up
removes EnableForcePush and other unrelated code
2022-09-08 12:36:55 -05:00
Megan Bang
72ba8a869e removes EnableForcePush and other unrelated code 2022-09-02 14:49:25 -05:00
Alisdair McDiarmid
bce43faf2e
Merge pull request #31729 from hashicorp/alisdair/typeexpr-upstreamed
Use upstreamed HCL typexpr package
2022-09-02 10:15:33 -04:00
Alisdair McDiarmid
9d864c2430 Use upstreamed HCL typexpr package
The 2.14.0 release of HCL includes the typeexpr changes we tested here,
so now we can revert to using the HCL package and remove our fork.
2022-09-01 16:03:48 -04:00
Martin Atkins
b8bc1dd721
Update CHANGELOG.md 2022-08-31 09:16:07 -07:00
fatahfattah
8a31f0a6c8
addrs: ModuleSourceRemote.String correctly handles query string in URL
Previously it would append the "subdir" portion onto the query string, producing an invalid result.
2022-08-31 09:13:24 -07:00
kmoe
ba113ff2cd
add destroy option to terraform apply help text (#31714) 2022-08-31 15:13:26 +01:00
kmoe
6ac24d8002
Update CHANGELOG.md 2022-08-31 10:55:30 +01:00
kmoe
a9155e9cfe
Update CHANGELOG.md 2022-08-31 10:22:35 +01:00
James Bardin
522556534d
remove deprecated backends (#31711)
* remove deprecated backends

* remove backend docs

Remove references to deprecated backends from docs.
2022-08-31 10:17:07 +01:00
kmoe
3dbf5cc623
Update CHANGELOG.md 2022-08-31 09:43:38 +01:00
megan07
cb340207d8
Merge pull request #31698 from hashicorp/megan_tf563
Send the JSON state representation to Cloud backend (when available)
2022-08-30 18:10:45 -05:00
Megan Bang
37b7e6ebce don't check diags for errors 2022-08-30 18:03:57 -05:00
Megan Bang
4d749e2813 add warning to diags and show at the end of each command 2022-08-30 17:52:51 -05:00
Megan Bang
5eaa4c45c0 fix imports 2022-08-30 17:27:15 -05:00
Megan Bang
de8bd5826f first part of code review comments 2022-08-30 17:01:44 -05:00
kmoe
477f7fe9a9
Update CHANGELOG.md 2022-08-30 18:04:02 +01:00
kmoe
dec48a8510
plans: indicate when resource deleted due to move (#31695)
Add a new ChangeReason, ReasonDeleteBecauseNoMoveTarget, to provide better
information in cases where a planned deletion is due to moving a resource to
a target not in configuration.

Consider a case in which a resource instance exists in state at address A, and
the user adds a moved block to move A to address B. Whether by the user's
intention or not, address B does not exist in configuration.
Terraform combines the move from A to B, and the lack of configuration for B,
into a single delete action for the (previously nonexistent) entity B.
Prior to this commit, the Terraform plan will report that resource B will be
destroyed because it does not exist in configuration, without explicitly
connecting this to the move.

This commit provides the user an additional clue as to what has happened, in a
case in which Terraform has elided a user's action and inaction into one
potentially destructive change.
2022-08-30 18:01:29 +01:00
Megan Bang
7e5b7b283e updates for code consistency 2022-08-30 09:49:09 -05:00
Megan Bang
dbf99f17b1 add test and removed backend state from cloud 2022-08-29 16:26:06 -05:00
Megan Bang
b504dd1489 update from code consistency checks 2022-08-29 14:29:07 -05:00
Megan Bang
485a1f6777 remove test for error 2022-08-29 14:25:15 -05:00
Megan Bang
bddf6a9b34 updating to use the latest version of cloud/state.go and just pass schemas along to PersistState in the remote state 2022-08-29 14:13:18 -05:00
Megan Bang
b572e57fb3 refactor GetSchemas to include an option to pass in a config 2022-08-29 11:32:14 -05:00
Megan Bang
40263cd861 undo taint test changes 2022-08-29 11:21:06 -05:00
Megan Bang
00cc1ea26d refactor getSchemas 2022-08-29 11:10:03 -05:00
Alisdair McDiarmid
1347aa29fd
Update init.mdx 2022-08-29 10:02:55 -04:00
Alisdair McDiarmid
0d35244253
Merge pull request #31682 from kmchau428/patch-1
Update init.mdx
2022-08-29 10:01:49 -04:00
Alisdair McDiarmid
e80f29df94
Update CHANGELOG.md 2022-08-29 09:09:37 -04:00
kmchau
38b3bf8edb
Update init.mdx
rephrased according to the suggestion.
2022-08-29 09:09:43 +08:00
Martin Atkins
71dec301a2 command/jsonchecks: Mark check result objects as experimental
This is a clumsy way to do this, but a pragmatic way to inform potential
consumers that this part of the format is not yet finalized without having
to read the docs to see our warning about that.

We need to get some practical experience with a few different consumers
making use of this format before we can be confident that it's designed
appropriately. We're not _expecting_ to break it, but we'd like to leave
the opportunity open in case we quickly learn that there's something
non-ideal about this design.
2022-08-26 15:47:29 -07:00
Martin Atkins
a8c255c779 command/jsonstate: Include check results in JSON state report 2022-08-26 15:47:29 -07:00
Martin Atkins
0e4e9f7706 addrs: Be explicit about checkable object address kinds
Previously we were attempting to infer the checkable object address kind
of a given address by whether it included "output" in the position where
a resource type name would otherwise go.

That was already potentially risky because we've historically not
prevented a resource type named "output", and it's also a
forward-compatibility hazard in case we introduce additional object kinds
with entirely-new addressing schemes in future.

Given that, we'll instead always be explicit about what kind of address
we're storing in a wire or file format, so that we can make sure to always
use the intended parser when reading an address back into memory, or
return an error if we encounter a kind we're not familiar with.
2022-08-26 15:47:29 -07:00
Martin Atkins
fe7e6f970e command/jsonplan: Include new-style check results in JSON plan output
This is a new-shaped representation of check results which follows the
two-tiered structure of static objects and dynamic instances of objects,
thereby allowing consumers to see which checkable objects exist in the
configuration even if a dynamic evaluation error prevented actually
expanding them all to determine their declared instances.

Eventually we'll include this in the state too, but this initially adds it
only to the plan in order to replace the now-deprecated experimental
conditions result that was present but undocumented in Terraform v1.2.
2022-08-26 15:47:29 -07:00
Martin Atkins
d63871f70d core: Propagate check results accurately from plan to apply
In an earlier commit we changed the states.CheckResults model to
explicitly model the config object vs. dynamic checkable object hierarchy,
but neglected to update the logic in Terraform Core to take that into
account when propagating the object expansion decisions from the plan
phase to the apply phase. That meant that we were incorrectly classifying
zero-instance resources always as having an unknown number of instances,
rather than possibly being known to have zero instances.

This now follows the two-level heirarchy of the data structure, which has
the nice side-effect that we can remove some of the special-case methods
from checks.State that we were using to bulk-load data: the data is now
shaped in the appropriate way to reload the data using the same method
the plan phase would've used to record the results in the first place.
2022-08-26 15:47:29 -07:00
Martin Atkins
6de3b1bd16 states/statefile: Serialize check results into state snapshots
This allows us to retain check results from one run into the next, so that
we can react to status changes between runs and potentially report e.g.
that a previously-failing check has now been fixed, or that a
previously-failing check is "still failing" so that an operator can get
a hint as to whether a problem is something they've just introduced or if
it was already an active problem before they made a change.
2022-08-26 15:47:29 -07:00
Martin Atkins
9e4861adbb states: Two-level representation of check results
A significant goal of the design changes around checks in earlier commits
(with the introduction of package "checks") was to allow us to
differentiate between a configuration object that we didn't expand at all
due to an upstream error, which has _unknown_ check status, and a
configuration object that expanded to zero dynamic objects, which
therefore has a _passing_ check status.

However, our initial lowering of checks.State into states.CheckResults
stayed with the older model of just recording each leaf check in isolation,
without any tracking of the containers.

This commit therefore lightly reworks our representation of check results
in the state and plan with two main goals:
- The results are grouped by the static configuration object they came
  from, and we capture an aggregate status for each of those so that
  we can differentiate an unknown aggregate result from a passing
  aggregate result which has zero dynamic associated objects.
- The granularity of results is whole checkable objects rather than
  individual checks, because checkable objects have durable addresses
  between runs, but individual checks for an object are more of a
  syntactic convenience to make it easier for module authors to declare
  many independent conditions that each have their own error messages.

Since v1.2 exposed some details of our checks model into the JSON plan
output there are some unanswered questions here about how we can shift to
reporting in the two-level heirarchy described above. For now I've
preserved structural compatibility but not semantic compatibility: any
parser that was written against that format should still function but will
now see fewer results. We'll revisit this in a later commit and consider
other structures and what to do about our compatibility constraint on the
v1.2 structure.

Otherwise though, this is an internal-only change which preserves all of
the existing main behaviors of conditions as before, and just gets us
ready to build user-facing features in terms of this new structure.
2022-08-26 15:47:29 -07:00
Martin Atkins
3785619f93 core: Use the new checks package for condition tracking
The "checks" package is an expansion what we previously called
plans.Conditions to accommodate a new requirement that we be able to track
which checks we're expecting to run even if we don't actually get around
to running them, which will be helpful when we start using checks as part
of our module testing story because test reporting tools appreciate there
being a relatively consistent set of test cases from one run to the next.

So far this should be essentially a no-op change from an external
functionality standpoint, aside from some minor adjustments to how we
report some of the error and warning cases from condition evaluation in
light of the fact that the "checks" package can now track errors as a
different outcome than a failure of a valid check.

As is often the case with anything which changes what we track
in the EvalContext and persist between plan and apply, Terraform Core is
pretty brittle and so this had knock-on effects elsewhere too. Again, the
goal is for these changes to not create any material externally-visible
difference, and just to accommodate the new assumption that there will
always be a "checks" object available for tracking during a graph walk.
2022-08-26 15:47:29 -07:00
Martin Atkins
9dea19807f checks: A new package for modeling custom condition checks
The checks.Checks type aims to encapsulate keeping track of check results
during a run and then reporting on them afterwards even if the run was
aborted early for some reason.

The intended model here is that each new run starts with an entirely fresh
checks.Checks, with all of the statuses therefore initially unknown, and
gradually populates the check results as we walk the graph in Terraform
Core. This means that even if we don't complete the run due to an error
or due to targeting options we'll still report anything we didn't visit
yet as unknown.

This commit only includes the modeling of checks in the checks package.
For now this is just dead code, and we'll wire it in to Terraform Core in
subsequent commits.
2022-08-26 15:47:29 -07:00
Martin Atkins
696b403bf3 addrs: OutputValue.InModule
Similar to other address types, this wraps the receiver up in its
associated "config" type, binding it to a particular not-yet-expanded
module.
2022-08-26 15:47:29 -07:00
Martin Atkins
209b8de7a5 configs: Variable and Output both have Addr methods
We previously added methods like this for some of the other types in this
package, including Local in this same file, but apparently haven't needed
these two yet.
2022-08-26 15:47:29 -07:00
Martin Atkins
d06cbfe6c8 addrs: ConfigCheckable type
Our existing addrs.Checkable represents a particular (possibly-dynamic)
object that can have checks associated with it.

This new addrs.ConfigCheckable represents static configuration objects
that can potentially generate addrs.Checkable objects.

The idea here is to allow us to predict from the configuration a set of
potential checkable object containers and then dynamically associate
the dynamic checkable objects with them as we make progress with planning.

This is intended for our integration of checks into the "terraform test"
testing harness, to be used instead of the weirdo builtin provider we were
using as a placeholder before we had first-class syntax for checks.
Test reporting tools find it helpful for there to be a consistent set of
test cases from one run to the next so that they can report on trends over
multiple runs, and so our ConfigCheckable addresses will serve as the
relatively-static "test case" that we'll then associate the dynamic checks
with, so that we can still talk about objects in the test result report
even if we end up not reaching them due to an upstream conditution failure.
2022-08-26 15:47:29 -07:00
Megan Bang
344379f5c7 fix cloud state breaking? 2022-08-26 16:26:09 -05:00