Commit Graph

30725 Commits

Author SHA1 Message Date
Liam Cervante
b917154a97
Make required JSON structured output structures public for processing (#32367)
* prep for processing the structured run output

* undo unwanted change to a json key
2023-01-09 10:48:23 +01:00
kmoe
4fc02469e7
docs: delete outdated Resource Lifecycle page (#32387)
* Delete lifecycle.mdx

* remove resource lifecycle link

* Update internals-nav-data.json
2023-01-06 17:06:09 +00:00
James Bardin
e200f53ec0
Merge pull request #32464 from hashicorp/jbardin/output-check-refs
Ensure we have all references for output preconditions
2023-01-05 14:29:43 -05:00
James Bardin
45cb0489d0 test references only from output preconditions
These references were getting dropped, which could cause the referenced
nodes to be pruned from the graph.
2023-01-05 10:01:25 -05:00
James Bardin
1790f844b3 output refs missing error_message
Output references must also include the error_message expression.
Fix the early return in referencesForOutput, which could skip
preconditions. The small slice allocation optimization is not really
needed here, since this is not a hot path at all.
2023-01-05 09:59:52 -05:00
James Bardin
6e2a7496c4 update CHANGELOG.md 2023-01-04 12:47:38 -05:00
James Bardin
721df0e68d
Merge pull request #32395 from hashicorp/jbardin/plan-output-on-error
Always show and store planned actions and checks even when planning fails
2023-01-04 12:44:52 -05:00
Liam Cervante
8e1b660b79
Update equivalence tests to counter non-deterministic output (#32366) 2023-01-04 17:36:43 +01:00
James Bardin
5bcfd36c26
Merge pull request #32428 from hashicorp/jbardin/ignore-changes-panic
don't panic with a null list block value in config
2023-01-04 09:20:38 -05:00
Craig Wright
deea9b24a9
Merge pull request #32442 from Twixes/patch-1
Add missing HCL syntax highlighting in `composition.mdx`
2023-01-03 15:56:43 -08:00
Michael Matloka
28d7a685a9
Add missing HCL syntax highlighting in composition.mdx 2022-12-30 00:36:19 +01:00
James Bardin
ea193d5ce6 don't panic with a null list block value in config
Using ignore_changes with a list block, where the provider returned an
invalid null value for that block, can result in a panic when validating
the plan.

Future releases may prevent providers from storing a null block in
state, however we can avoid the panic for now. Only the NestingList case
needs to be handled, because legacy providers only have list and set
blocks, and the set case does not use the config value.
2022-12-21 15:01:03 -05:00
James Bardin
0e46d0ad25
Merge pull request #32424 from hashicorp/jbardin/reify-null-blocks
fix invalid null blocks during refresh
2022-12-21 13:17:41 -05:00
James Bardin
d493e998e1 add resource address to log message 2022-12-21 10:53:11 -05:00
James Bardin
a6098b67fa fix test state 2022-12-21 10:47:07 -05:00
James Bardin
0c1aaba635 fix invalid null blocks during refresh
Legacy providers may return null values for nested blocks during
refresh. Because the ReadResource call needs to accept any value to
allow the provider to report external changes, we allowed all changes to
the value as long as the underlying cty.Type was correct, allowing
null block values to be inserted into the state.

While technically invalid, we needed to accept these null values for
compatibility, and they were mostly seen as a nuisance, causing noise in
external changes and plan output. These null block values however can be
inserted into the effective configuration with the use of
`ignore_changes`, which can cause problems where the configuration is
assumed to be completely valid.

Rather than accept the null values, we can insert empty container values
for these blocks when refreshing the instance, which will prevent any
invalid values from entering state at all. Because these must still be
accepted for compatibility, we can only log the difference as a warning.
Currently the NormalizeObjectFromLegacySDK does not report which
specific blocks it fixed, so we just log a generic message.
2022-12-21 10:18:26 -05:00
Craig Wright
898b0aa78b
Merge pull request #32404 from stefansundin/add-missing-apt-repos
website: add missing Ubuntu apt repositories jammy and kinetic to the list
2022-12-19 17:15:27 -08:00
Stefan Sundin
a4a1f47027 Add missing Ubuntu apt repositories jammy and kinetic to the list. 2022-12-16 21:57:26 -08:00
James Bardin
49a0eb5ed8 update CHANGELOG.md 2022-12-16 15:32:33 -05:00
James Bardin
5605f20686 update CHANGELOG.md 2022-12-16 15:30:37 -05:00
James Bardin
25ac4d33e4
Merge pull request #31633 from brittandeyoung/f-workspace-selectornew
New Terraform Workspace select flag: `-or-create`
2022-12-16 15:29:25 -05:00
Brittan DeYoung
8881418c99
Update internal/command/workspace_select.go
Co-authored-by: James Bardin <j.bardin@gmail.com>
2022-12-16 15:03:46 -05:00
James Bardin
d60d247e40
Merge pull request #31318 from twittyc/twittyc/terraformWorkspaceInvalidArgsReturnsNon0
Bug fix: Terraform workspace command returns zero exit code when given an invalid argument.
2022-12-16 13:16:56 -05:00
James Bardin
3cda7a0269
Merge pull request #29520 from ComBin/main
Don't show symbols while input if variable marked as sensitive
2022-12-16 13:13:33 -05:00
James Bardin
76d5e4a9cb add command test for errored plan 2022-12-14 16:23:31 -05:00
James Bardin
bb5f360747 always report condition errors
The status in the face of errors didn't matter before, because we never
wrote out a plan with errors.
2022-12-14 14:45:04 -05:00
James Bardin
5aa088e385 remove -always-out
Make writing a plan file the default. We already create plans which have
no changes so the plan result would need to be checked in automation, so
having plans with errors should not pose a problem.

If we find workflows which cannot handle a plan that can't be applied,
we can reevaluate the need for a specialized flag. In the meantime, it
feels more logical that the plan output would always describe the result
of the plan, even if that included errors.
2022-12-14 11:09:34 -05:00
Liam Cervante
6af6540233
Use the apparentlymart/go-versions library to parse module constraints (#32377)
* Use the apparentlymart/go-versions library to parse module constraints

* goimports

* Update comments, and parse versions carefully

* add acceptance tests to verify behaviour of partial matches

* goimports
2022-12-14 17:02:11 +01:00
Martin Atkins
4660dacd59 command: Prototype of handling errored plans
This is a prototype of how the CLI layer might make use of Terraform
Core's ability to produce a partial plan if it encounters an error during
planning, with two new situations:

- When using local CLI workflow, Terraform will show the partial plan
  before showing any errors.
- "terraform plan" has a new option -always-out=..., which is similar to
  the existing -out=... but additionally instructs Terraform to produce
  a plan file even if the plan is incomplete due to errors. This means
  that the plan can still be inspected by external UI implementations.

This is just a prototype to explore how these parts might fit together.
It's not a complete implementation and so should not be shipped. In
particular, it doesn't include any mention of a plan being incomplete in
the "terraform show -json" output or in the "terraform plan -json" output,
both of which would be required for a complete solution.
2022-12-12 17:17:42 -05:00
Martin Atkins
6d9ddbacec core: Mark errored plans as errored
In any situation where we return a plan object along with some errors
we'll also explicitly annotate the plan object as being errored so that
we can catch if someone accidentally tries to apply that incomplete plan.

At the moment this situation is impossible to reach but in a later commit
we'll make it possible to save errored plans to disk for further
inspection, at which point it'll become important to not allow applying
them.
2022-12-12 17:17:42 -05:00
Martin Atkins
6611e3a9cd core: Possibly return a partial plan alongside errors
For some kinds of plan failure we will already have successfully completed
planning for at least one upstream object before encountering a downstream
error.

Since a downstream failure can be caused by an already-recorded action
from upstream, it might be helpful to inspect the actions planned so far
in order to understand better why the error occurred.

This doesn't yet make this result visible anywhere, and is backward
compatible with existing callers because they currently entirely ignore
the returned plan pointer if the diagnostics contains at least one error.
2022-12-12 17:17:42 -05:00
James Bardin
a9230c9e75 update CHANGELOG.md 2022-12-12 15:20:58 -05:00
James Bardin
404b284911
Merge pull request #31757 from hashicorp/jbardin/terraform-data
New `terraform_data` managed resource to replace `null_resource`
2022-12-12 15:17:02 -05:00
Conor Evans
e206d4e83e
fix(unlock): amend force-unlock description (#32363)
Signed-off-by: Conor Evans <coevans@tcd.ie>

Signed-off-by: Conor Evans <coevans@tcd.ie>
2022-12-09 16:15:27 +00:00
Bryan Stenson
b2f6813341
typo (#32327) 2022-12-09 16:14:01 +00:00
The Terraform Team
7d57d59959 Automated equivalence test golden file update for release v1.4.0-alpha20221207. 2022-12-07 15:19:56 +00:00
hc-github-team-tf-core
e4e0322d2a Cleanup after v1.4.0-alpha20221207 release 2022-12-07 15:08:58 +00:00
hc-github-team-tf-core
cf0cdf680c
Release v1.4.0-alpha20221207 2022-12-07 14:54:15 +00:00
kmoe
5c8208df34
build with Go 1.19.4 (#32351) 2022-12-07 14:32:56 +00:00
kmoe
d26e79c0d3
Update CHANGELOG.md 2022-12-07 14:15:03 +00:00
hellertang
9dbaac5975
add accelerate (#32344) 2022-12-07 10:05:42 +00:00
Matthew Garrell
6ebc30ddcb
Merge pull request #32007 from alloveras/patch-1
The NETRC environment variable is honoured
2022-12-06 13:16:25 -05:00
James Bardin
d0d6501c1f s/trigger/triggers_replace/
Rename `triggers` to be more descriptive, making it similar to
`replace_triggered_by`.
2022-12-05 15:23:57 -05:00
James Bardin
58e15c7f0e add terraform_data e2e test 2022-12-05 15:23:57 -05:00
James Bardin
3b73ed3348 new terraform_data managed resource
Replace and enhance the `null_resource` functionality with a new
`terraform_data` managed resource.
2022-12-05 15:23:57 -05:00
Alisdair McDiarmid
e0b226a3b8
Update CHANGELOG.md 2022-12-05 10:05:27 -05:00
Alisdair McDiarmid
80fddc431e
Merge pull request #32295 from xiaozhu36/xiaozhu
backend/oss: Ignore the getting oss endpoint error and using string concat instead; Improves the error message level
2022-12-05 10:03:20 -05:00
xiaozhu36
ec62ca1b70 backend/oss: Ignore the getting oss endpoint error and using string concat instead; Improves the error message level 2022-12-04 11:51:29 +08:00
HashiBot
6d9dc22834
chore: Update Digital Team Files (#32322)
* Update generated scripts (should-build.sh)

* Update generated website Makefile

* Update generated scripts (website-build.sh)

* Update generated scripts (website-start.sh)
2022-12-02 10:24:25 -05:00
Liam Cervante
2325ec716c
Update Terraform equivalence tests to remove unneeded input. (#32288)
* test

* update equivalence testing framework version

* Remove debugging statements

* remove more debugging statements

* s/liamcervante/hashicorp/g

* remove and update deprecated set-output statements
2022-12-02 11:22:02 +01:00