Commit Graph

30563 Commits

Author SHA1 Message Date
kmoe
62d22a9406
Update CHANGELOG.md 2022-09-29 13:39:13 +01:00
Radek Simko
196ff4c5c5
providercache: Improve installation error message (#31898) 2022-09-29 13:37:04 +01:00
James Bardin
8c98e1f4a4
Merge pull request #31747 from hashicorp/jbardin/ignore-changes-all-computed
filter computed attrs from `ignore_changes=all`
2022-09-28 09:27:34 -04:00
Sarah French
a29fefbec7
Update codeowner of gcs backend to include Strategic Integrations team (#31848)
* Update codeowner of gcs backend to SI team

* Update CODEOWNERS of gcs backend
2022-09-27 21:38:52 +01:00
zisom-hc
d08fcd63db
Update custom-conditions.mdx
Made a change to code example within the *Preconditions and Postconditions* section so that it technically makes sense; prior it was missing the data resource that was being called within the precondition lifecycle event on line 135, and the aws_instance resource was not utilizing the ami being provided by the data source in line 129, so i changed that as well.
2022-09-26 14:53:47 -07:00
Martin Atkins
cc964e6b0b core: Document that TransformRoot must produce coalescable node
We use a non-pointer value for this particular node, which means that
there can never be two root nodes in the same graph: the graph
implementation will just coalesce them together when a second one is added.

Our resource expansion code is relying on that coalescing so that it can
subsume together multiple graphs for different modules instances into a
single mega-graph with all instances across all module instances, with
any root nodes coalescing together to produce a single root.

This also updates one of the context tests that exercises resource
expansion so that it will generate multiple resource instance nodes per
module and thus potentially have multiple roots to coalesce together.
However, we aren't currently explicitly validating the return values from
DynamicExpand and so this test doesn't actually fail if the coalescing
doesn't happen. We may choose to validate the DynamicExpand result in a
later commit in order to make it more obvious if future modifications fail
to uphold this invariant.
2022-09-26 13:46:25 -07:00
Martin Atkins
2e177cd632 core: Eliminate NodePlannableResource indirection
We previously did two levels of DynamicExpand to go from ConfigResource to
AbsResource and then from AbsResource to AbsResourceInstance.

We'll now do the full expansion from ConfigResource to AbsResourceInstance
in a single DynamicExpand step inside nodeExpandPlannableResource.

The new approach is essentially functionally equivalent to the old except
that it fixes a bug in the previous implementation: we will now call
checkState.ReportCheckableObjects only once for the entire set of
instances for a particular resource, which is what the checkable objects
infrastructure expects so that it can always mention all of the checkable
objects in the check report even if we bail out partway through due to
a downstream error.

This is essentially the same code but now turned into additional methods
on nodeExpandPlannableResource instead of having the extra graph node
type. This has the further advantage of this now being straight-through
code with standard control flow, instead of the unusual inversion of
control we were doing before bouncing in and out of different Execute and
DynamicExpand implementations to get this done.
2022-09-26 13:46:25 -07:00
Martin Atkins
a9bd4099d3 core: DynamicExpand can return diagnostics
We were previously _trying_ to handle diagnostics here but were not quite
doing it right because we were testing whether the resulting error was
nil rather than appending it to the diagnostics and then seeing if the
result has errors.

The difference here is important because it allows DynamicExpand to return
warnings without associated errors when needed. Previously the graph
walker would treat a warnings-only result as if it were an error.

Ideally we'd change DynamicExpand to return diagnostics directly, but we
previously decided against that because there were so many implementors
to update, and my intent for this change is to be surgical in the update
so we minimize risk of backporting the change into patch releases.
2022-09-26 13:46:25 -07:00
James Bardin
dbaf6d63f3
Merge pull request #31871 from hashicorp/jbardin/remove-planned-during-import
RemovePlannedResourceInstanceObjects during import
2022-09-26 14:24:23 -04:00
James Bardin
008810f593
Merge pull request #31858 from hashicorp/jbardin/prune-plan-destroy
prune unused nodes from a destroy plan graph
2022-09-26 14:24:07 -04:00
James Bardin
1c8352d926
Merge pull request #31857 from hashicorp/jbardin/destroy-edge-cycles
prevent cycles when connecting destroy nodes
2022-09-26 14:23:45 -04:00
James Bardin
ce02344589 prevent cycles when connecting destroy nodes
When adding destroy edges between resources from different providers,
and a provider itself depends on the other provider's resources, we can
get cycles in the final dependency graph.

The problem is a little deeper than simply not connecting these nodes,
since the edges are still needed when doing a full destroy operation.
For now we can get by assuming the edges are required, and reverting
them only if they result in a cycle. This works because destroy edges
are the last edges added to managed resources during graph building.

This was rarely a problem before v1.3, because noop nodes were not added
to the apply graph, and unused values were aggressively pruned. In v1.3
however all nodes are kept in the graph so that postcondition blocks are
always evaluated during apply, increasing the chances of the cycles
appearing.
2022-09-26 13:38:17 -04:00
James Bardin
5bca0c609b RemovePlannedResourceInstanceObjects during import
Because import uses the complete planning process, it must also call
RemovePlannedResourceInstanceObjects. This is required to serialized the
resulting state if there are data sources with an ObjectPlanned status
because they could not be read during the import process.
2022-09-25 14:41:53 -04:00
Laura Pacilio
a8ea377e7f
Merge pull request #31849 from hashicorp/workspaces-confusion-fixes
Update workspace documentation
2022-09-23 17:46:32 -04:00
Laura Pacilio
0471c80ebe
Update website/docs/language/state/workspaces.mdx 2022-09-23 17:25:24 -04:00
Laura Pacilio
2ea3765fa6
Update website/docs/language/state/workspaces.mdx 2022-09-23 17:24:54 -04:00
Laura Pacilio
6753fb5476
Update website/docs/language/state/workspaces.mdx 2022-09-23 17:24:39 -04:00
Laura Pacilio
776c25777d
Update website/docs/language/state/workspaces.mdx 2022-09-23 17:17:06 -04:00
Laura Pacilio
94eed2c45b Incorporate PR feedback 2022-09-23 16:32:15 -04:00
James Bardin
aedd95a1ee prune unused nodes from a destroy plan graph
We may need to prune nodes from a full destroy plan graph which cannot
be evaluated if there is no current state.

Add missing method to nodeExpandPlannableResource to ensure planned
resource are handled correctly when pruning nodes.
2022-09-23 14:56:04 -04:00
UKEME BASSEY
a5926f1e9a
Merge pull request #31813 from hashicorp/uk1288-redact-output-sensitive-values
omit sensitive output values in logs from terraform apply json command
2022-09-23 14:54:00 -04:00
Alisdair McDiarmid
6448d7bfd6
Merge pull request #31847 from hashicorp/alisdair/pre-convert-optional-defaults
Upgrade hcl to fix crash with optional attributes
2022-09-23 12:46:58 -04:00
Alisdair McDiarmid
10ae444ee2 Upgrade HCL to fix optional attr default crash
Also add regression test coverage of the crash. This would occur when
objects with optional attributes had default values of different type
from the attribute type, and the objects were members of a collection.

For example:

list(object({
  a = optional(set(string), [])
}))

If this type constraint is applied to a variable value where one object
has a set(string) value for a, and the other object applies the empty
tuple default, Terraform would crash.
2022-09-23 10:34:54 -04:00
Matthew Garrell
1e6f091976
Merge pull request #31598 from bobsut/patch-1
insert missing infinitive particle
2022-09-23 08:49:18 -04:00
Laura Pacilio
f7bf19525e Move TFC workspaces section further down 2022-09-22 19:11:14 -04:00
Laura Pacilio
35a5e92687 language fix 2022-09-22 19:07:55 -04:00
Laura Pacilio
2fc8289cf1 More updates to workspaces in language 2022-09-22 19:03:42 -04:00
Laura Pacilio
6c34047efa Update workspace documentation 2022-09-22 18:50:08 -04:00
UKEME BASSEY
7b34e3e743 redact sensitive output values in run logs 2022-09-22 13:47:47 -04:00
Alisdair McDiarmid
4153685bfe
Merge pull request #31814 from hashicorp/alisdair/pull-request-template
Add initial pull request template
2022-09-22 09:23:28 -04:00
Alisdair McDiarmid
3ff89c9cec
Update pull_request_template.md 2022-09-22 09:17:31 -04:00
Craig Wright
6381fdd8fd
Merge pull request #31841 from koki-develop/startsswith-to-startswith
fixed typo: `startsswith` -> `startswith`
2022-09-21 18:47:52 -07:00
koki-develop
d5df330696 fixed typo: startsswith -> startswith 2022-09-22 08:53:11 +09:00
Alisdair McDiarmid
612e27985f
Merge pull request #31840 from hashicorp/alisdair/1.4
Update main branch version to 1.4.0
2022-09-21 17:43:17 -04:00
Alisdair McDiarmid
b02554cb51
Update main branch version to 1.4.0 2022-09-21 17:27:38 -04:00
Glenn Sarti
1773129832 Add tests for cloud backend taskStage 2022-09-21 09:40:52 +08:00
Laura Pacilio
31fc22a0d2
Merge pull request #31831 from hashicorp/optional-type-attributes-note
Remove unnecessary version note
2022-09-20 17:01:58 -04:00
Laura Pacilio
9582cc2d0f
Remove unnecessary version note 2022-09-20 16:25:51 -04:00
S Dinay
bbf60cdd65
Update links aws_s3_bucket_object to aws_s3_bucket
The remote-state-data documentation page refers to the aws_s3_bucket_object resource and data which is deprecated. The documentation says to use aws_s3_object instead. This change updates the links for the S3 object solution for remote state.
2022-09-20 11:11:37 -07:00
Laura Pacilio
0d35127efa
Merge pull request #31818 from hashicorp/fix-internals-overview
Add internals overview page to navigation
2022-09-20 14:05:35 -04:00
James Bardin
3e281e1eda default optional+computed to prior value 2022-09-20 11:00:19 -04:00
Glenn Sarti
43371b8293 Add support for pre-apply task results in the cloud backend
Previously the cloud backend only supported the pre and post plan stages.
This commit adds support to display the output of the new pre-apply task
stage as well.
2022-09-20 16:18:33 +08:00
Glenn Sarti
18da2f0213 Refactor task stage retrieval in cloud backend
Previously all of the logic to retrieve Task Stages was in the backend_plan.go file.
This commit:
* Moves the logic to the backend_taskStages.go file.
* Replaces using an array to a map indexed by the Task Stage's stage. This makes it
  easier to find the relevant stage in the list and means the getTaskStageIDByName
  function is no longer required.
2022-09-20 16:18:33 +08:00
Glenn Sarti
fc7b6b7f15 Upgrade go-tfe to 1.10.0
This commit updates the go-tfe library to the latest version (1.10.0). This is needed by
later commits for the pre-apply task stage.
2022-09-20 16:18:19 +08:00
Craig Wright
0cc752ee9d
Merge pull request #31812 from martynassateika/patch-1
Update taint.mdx - remove repeated word.
2022-09-19 14:56:45 -07:00
Laura Pacilio
a21154cc52
Update website/data/internals-nav-data.json 2022-09-19 16:30:23 -04:00
Laura Pacilio
0567b22252 Add internals overview page to navigation 2022-09-19 14:40:45 -04:00
Alisdair McDiarmid
99fcb747e9
Revise markup to avoid unwanted checklist UI 2022-09-19 11:40:35 -04:00
Alisdair McDiarmid
6c75e54681 Add initial pull request template
This is intended to add some structure to pull request descriptions, and
encourage peer review of changelog entries before merging a PR.
2022-09-19 10:11:36 -04:00
Martynas Šateika
c726a25fcd
Update taint.mdx 2022-09-19 13:44:14 +01:00