Commit Graph

30754 Commits

Author SHA1 Message Date
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
James Bardin
07e2d56050 update CHANGELOG.md 2022-12-01 10:27:04 -05:00
James Bardin
cbcae8478f
Merge pull request #32209 from hashicorp/jbardin/data-source-destroy-edges
ensure destroy edges from data sources
2022-12-01 10:25:42 -05:00
James Bardin
23aaa39747
Merge pull request #32308 from hashicorp/jbardin/output-eval-fix
always evaluate outputs from state during apply
2022-12-01 09:33:31 -05:00
James Bardin
c66a797f2a
Merge pull request #32307 from hashicorp/jbardin/output-perf
don't re-set changes for refreshed outputs
2022-11-30 14:06:50 -05:00
Martin Atkins
e216b8180f
Update CHANGELOG.md 2022-11-29 17:47:55 -08:00
Martin Atkins
e039a012c2
Update CHANGELOG.md 2022-11-29 17:47:22 -08:00
Martin Atkins
8253821e56 go get github.com/zclconf/go-cty-yaml@v1.0.3
This includes the fix for a bug in what Terraform calls the "yamldecode"
function, where it was not correctly handling any situation where the
decode result is a null value. It was previously returning an unknown
value in that case, whereas now it returns a null value as expected.
2022-11-29 17:45:45 -08:00
Laura Pacilio
1ce0b91e67
Merge pull request #32020 from hashicorp/fix-future-lang-2
Remove future-facing language from docs (WIP)
2022-11-29 15:09:21 -05:00
Laura Pacilio
97f9cb1645 Remove unnecessary explanation 2022-11-29 15:00:36 -05:00
Laura Pacilio
a76b634f82
Update website/docs/internals/json-format.mdx 2022-11-29 14:56:58 -05:00
Liam Cervante
c1633436b8
Add more equivalence test cases (#32296) 2022-11-29 12:36:52 +01:00
James Bardin
dcd762e81d evaluate outputs from state
Outputs were being evaluated from changes, even during apply. Make sure
we update the state correctly, and remove the existing change. This
requires adding more Planning fields to the output nodes to
differentiate whether the output is being planned or applied because the
same type handles both cases. We can evaluate separately whether new
types should be introduced to deal with both cases.

The module node cleanup was also prematurely removing module outputs
from the state before evaluation. This was not noticed before because
the evaluation was always falling back to changes. Have the root module
node do the final cleanup for all its children.

It turns out sensitive was also being handled incorrectly, and only
sensitive from configuration was being considered. Make sure to mark the
output as sensitive when storing sensitive values into state, and OR
sensitive marks with the state config when evaluating the output values.
2022-11-28 16:39:55 -05:00
James Bardin
c9d6f82ac5 don't re-set changes for refreshed outputs
When output values are updated in the refreshed state, we don't need to
re-set the changes which were already set in conjunction with the
current state.
2022-11-28 16:37:23 -05:00
alisdair
ec6451a82a
Merge pull request #31999 from JarrettSpiker/jspiker/workspace-delete-rum-docs
Update workspace delete command docs to reference RUM vs empty state
2022-11-25 12:07:02 -05:00
Jarrett Spiker
21d98697cb Add manual line breaks to workspace delete command help text 2022-11-25 11:42:22 -05:00
Liam Cervante
37b88b33ce
Rollout equivalence testing during Terraform releases and builds (#31928)
* add some basic equivalence tests and execute them in the build pipeline

* remove old file, now unused

* update terraform-equivalence-testing to v0.2.0

* add separate action

* make sure to read from hashicorp repo

* remove elevated github token where possible

* Don't need elevated token anymore

* update with official mock provider

* last change: don't need the authorization header for public repositories.
2022-11-24 14:00:08 +01:00
Jarrett Spiker
1e1312fb78 Remove use of RUM acronymn in workspace delete docs 2022-11-22 15:10:58 -05:00
Jarrett Spiker
f5a424e65d
Update website/docs/cli/commands/workspace/delete.mdx
Co-authored-by: Brandon Croft <brandon.croft@gmail.com>
2022-11-22 15:01:57 -05:00
James Bardin
2b14670dfd
Merge pull request #32260 from hashicorp/jbardin/resolved-provided-by
ProvidedBy should return the resolved provider
2022-11-22 09:53:41 -05:00
James Bardin
60f82eea40
Merge pull request #32236 from hashicorp/jbardin/1.3-destroy-perf
check walkDestroy to help DestroyEdgeTransformer
2022-11-22 09:45:32 -05:00
James Bardin
c96da72319
Merge pull request #32246 from hashicorp/jbardin/plan-orphan-deleted
A deleted orphan should have no planned change
2022-11-22 09:43:34 -05:00