Commit Graph

30911 Commits

Author SHA1 Message Date
Alisdair McDiarmid
584811b829 initwd: Add fake range for fake root module
This isn't currently used anywhere downstream, but it easily could be in
the future, so populating the range with some zero-ish data is more
robust.
2023-03-06 14:35:06 -05:00
Alisdair McDiarmid
d9eae48a75 Remove redundant CheckCoreVersionRequirements 2023-03-06 09:14:28 -05:00
Alisdair McDiarmid
5e83ccc1f9 Remove terraform-config-inspect 2023-03-06 09:14:28 -05:00
Alisdair McDiarmid
60ea68edc7 Remove earlyconfig 2023-03-06 09:14:28 -05:00
Alisdair McDiarmid
8df065a2fe initwd: Switch from earlyconfig to configs
This is a mostly mechanical refactor with a handful of changes which
are necessary due to the semantic difference between earlyconfig and
configs.

When parsing root and descendant modules in the module installer, we now
check the core version requirements inline. If the Terraform version is
incompatible, we drop any other module loader diagnostics. This ensures
that future language additions don't clutter the output and confuse the
user.

We also add two new checks during the module load process:

* Don't try to load a module with a `nil` source address. This is a
  necessary change due to the move away from earlyconfig.

* Don't try to load a module with a blank name (i.e. `module ""`).
  Because our module loading manifest uses the stringified module path
  as its map key, this causes a collision with the root module, and a
  later panic. This is the bug which triggered this refactor in the
  first place.
2023-03-06 09:14:28 -05:00
Craig Wright
3d51147862
Merge pull request #32766 from wisnij/wisnij/20230301-compact-docs
Thanks, we reviewed and approved.
2023-03-03 11:49:55 -08:00
Jim Wisniewski
f395efdd83
Update documentation for compact function 2023-03-01 17:34:33 -05:00
kmoe
76b34e891c
remove unused actionforchange (#32759) 2023-03-01 14:15:26 +00:00
Amanda B
93f9cff99f
Adding provider constraint best practice statement (#32697)
* Adding provider constraint best practice

Originally communicated here, this statement is missing in newer docs.

https://developer.hashicorp.com/terraform/language/v1.1.x/configuration-0-11/providers?ajs_aid=3cf1bdca-a598-4dc5-b074-6064b276abb6&_gl=1*xuizrx*_ga*MTM1ODg4NTcyMi4xNjY2MTA5NjI1*_ga_P7S46ZYEKW*MTY3NjU2OTMzNS4zMi4wLjE2NzY1Njk0MDMuMC4wLjA.&product_intent=terraform#provider-versions

* Update website/docs/language/providers/index.mdx

Co-authored-by: Judith Malnick <judith@hashicorp.com>

---------

Co-authored-by: Judith Malnick <judith@hashicorp.com>
2023-02-27 09:22:07 -08:00
Alisdair McDiarmid
729408333e
Merge pull request #32742 from rkhaled0/bugfix/issue-28274-providers-mirroring-honor-lockfile
bugfix: terraform providers mirror command should honor terraform lock file
2023-02-27 10:03:05 -05:00
Reda Khaled
100c44b6c3
bugfix: issue-28274, terraform providers mirror command should honor terraform lock file 2023-02-25 00:16:46 +01:00
Ashlee M Boyer
984d8c14a3
Merge pull request #32624 from hashicorp/docs/amb.migrate-link-formats
docs: Migrate link formats
2023-02-24 12:51:40 -05:00
kmoe
6fff41b6de
Delete maintainer-etiquette.md (#32741) 2023-02-24 16:31:58 +00:00
Ashlee Boyer
c850399c0d Updating main-branch-preview-url 2023-02-23 12:57:23 -05:00
Ashlee Boyer
32f7b8ebd0 Migrating links to new format 2023-02-23 12:55:56 -05:00
Ashlee Boyer
c5d0bd40b9 Removing test comment 2023-02-23 12:55:35 -05:00
Ashlee Boyer
55f11d07b9 Adding comment for testing 2023-02-23 12:55:15 -05:00
Ashlee Boyer
534366d0ff Adding test-link-rewrites workflow 2023-02-23 12:04:12 -05:00
Ashlee Boyer
e81c849617 Adding docs-content-check-legacy-links-format workflow 2023-02-23 12:04:12 -05:00
Martin Atkins
a86cef4d50 cliconfig: Allow breaking the dependency lock file using the environment
Since it's already possible to activate the dependency lock file using an
environment variable, we should allow opting in to it having broken
behavior using the environment too.

It's kinda odd in retrospect that TF_PLUGIN_CACHE_DIR is the only setting
we allow to be configured both in the environment and the CLI
configuration. That means that the infrastructure for dealing with that
situation was relatively immature here and so I did some light refactoring
to make it unit-testable without actually modifying the test program's
environment.
2023-02-22 12:23:56 -08:00
Brandon Croft
3d1a58d5b5
Merge pull request #32708 from mrinalirao/mr/taskStage-race
Bug Fix where CLI exits if run is not confirmable.
2023-02-21 18:17:51 -07:00
dependabot[bot]
cff7584a38 Bump golang.org/x/net from 0.5.0 to 0.7.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-21 16:31:19 -08:00
CJ Horton
3c54e42080
Merge pull request #32695 from hashicorp/radditude/init-config-warning
keep errors friendly when init encounters syntax problems
2023-02-21 16:09:05 -08:00
Brandon Croft
ec4f62078a
Merge pull request #32666 from hashicorp/sebasslash/fix-credentials-sourcing-backend
Fix SRO authorization bug when token is fetched from cloud config
2023-02-21 16:40:53 -07:00
CJ Horton
fd4876d81e
Merge pull request #32705 from hashicorp/radditude/crt-docs-cleanup
Remove docs bundle from build workflow
2023-02-21 11:08:52 -08:00
kmoe
b435b4ccde
cliconfig: more provider_installation err detail (#32722) 2023-02-21 18:18:57 +00:00
Sebastian Rivera
3f23a9e70a
Merge pull request #32696 from hashicorp/sebasslash/sro-provisioner-logs
Handle provisioner log types when rendering structured logs
2023-02-21 11:44:16 -05:00
Daniel Banck
b8f3f802f5
Add website docs for metadata functions -json command (#32701)
* Add metadata functions doc to internals

* Add metadata functions to internals nav

* Review feedback

* Renamed the doc
* Fixed small typos

* Update page title
2023-02-20 14:14:32 +00:00
Daniel Banck
f29156cdef
Replace HTML entities in function descriptions (#32710) 2023-02-20 14:11:06 +00:00
Mrinali Rao
afc9235f17
Update internal/cloud/backend_taskStages.go
Co-authored-by: Glenn Sarti <glennsarti@users.noreply.github.com>
2023-02-20 18:35:58 +11:00
mrinalirao
3104811c7d add test to see if override continues to poll on success 2023-02-20 17:50:25 +11:00
mrinalirao
190858b9e4 Bug Fix where CLI exits if run is not confirmable. 2023-02-20 17:18:13 +11:00
CJ Horton
25d8f26e41
Remove docs bundle from build workflow 2023-02-17 19:56:45 -08:00
Martin Atkins
6ab3faf5f6
Update CHANGELOG.md 2023-02-17 14:25:31 -08:00
Martin Atkins
c7aff57c92 build: Use Go 1.20.0
This changes which Go version we use for official releases and for
everyday development and testing.

At the time of this commit Go 1.20.1 is available but is not yet included
in goenv, the tool that we use in some environments for reacting
automatically to this file. I expect we'll upgrade to Go 1.20.1 very soon,
but this is a routine upgrade to the latest major release so that we can
start soaking in the new compiler and library behaviors throughout the
v1.5 development period.

Go 1.20 continues to support only Unicode 13, so we do not need to make
any changes to our supporting packages that also rely on Unicode data.
2023-02-17 14:24:52 -08:00
James Bardin
014a425d0e
Merge pull request #32683 from hashicorp/jbardin/import-terraform-data
allow terraform_data to import
2023-02-17 09:51:02 -05:00
Alisdair McDiarmid
cc6ea4abc2
Merge pull request #32678 from Jukie/go-getter-update
Update go-getter version
2023-02-17 07:04:36 -05:00
Sebastian Rivera
6d0a191ec4 Handle provisioner log types in renderer 2023-02-16 10:54:58 -05:00
CJ Horton
30f8b014f8 keep the friendly error message whenever possible 2023-02-15 21:40:46 -08:00
CJ Horton
727e22e762 add tests for init syntax error handling
With the demise of the early config loader, we want to show core
version errors first, followed by backend errors, and only then
show other errors with the configuration.
2023-02-15 21:01:27 -08:00
Martin Atkins
71774c2a37
Update CHANGELOG.md 2023-02-14 15:22:18 -08:00
Martin Atkins
f0de9b60c1 backend/local: Periodically persist intermediate state snapshots
Terraform Core emits a hook event every time it writes a change into the
in-memory state. Previously the local backend would just copy that into
the transient storage of the state manager, but for most state storage
implementations that doesn't really do anything useful because it just
makes another copy of the state in memory.

We originally added this hook mechanism with the intent of making
Terraform _persist_ the state each time, but we backed that out after
finding that it was a bit too aggressive and was making the state snapshot
history much harder to use in storage systems that can preserve historical
snapshots.

However, sometimes Terraform gets killed mid-apply for whatever reason and
in our previous implementation that meant always losing that transient
state, forcing the user to edit the state manually (or use "import") to
recover a useful state.

In an attempt at finding a sweet spot between these extremes, here we
change the rule so that if an apply runs for longer than 20 seconds then
we'll try to persist the state to the backend in an update that arrives
at least 20 seconds after the first update, and then again for each
additional 20 second period as long as Terraform keeps announcing new
state snapshots.

This also introduces a special interruption mode where if the apply phase
gets interrupted by SIGINT (or equivalent) then the local backend will
try to persist the state immediately in anticipation of a
possibly-imminent SIGKILL, and will then immediately persist any
subsequent state update that arrives until the apply phase is complete.
After interruption Terraform will not start any new operations and will
instead just let any already-running operations run to completion, and so
this will persist the state once per resource instance that is able to
complete before being killed.

This does mean that now long-running applies will generate intermediate
state snapshots where they wouldn't before, but there should still be
considerably fewer snapshots than were created when we were persisting
for each individual state change. We can adjust the 20 second interval
in future commits if we find that this spot isn't as sweet as first
assumed.
2023-02-14 15:17:56 -08:00
James Bardin
47fd019dbb
Merge pull request #32492 from hashicorp/bflad/lifecycle-computed-behavior
docs: Explicitly mention Computed-only attribute behavior for Proposed New State
2023-02-14 15:43:11 -05:00
James Bardin
55acdc6b31
Merge pull request #32679 from hashicorp/jbardin/terraform-data-docs
initial terraform_data docs
2023-02-14 15:11:58 -05:00
James Bardin
5adea6d58e change provisioner example in terraform_data
The existing example is already covered in the "Provisioners Without a
Resource" section, so make this one slightly different by triggering a
local-exec on multiple resources.
2023-02-14 15:05:41 -05:00
James Bardin
0a25e40aeb updates from review 2023-02-14 14:50:50 -05:00
James Bardin
1d0fc1c6c8
Update website/docs/language/meta-arguments/lifecycle.mdx
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2023-02-14 14:11:19 -05:00
James Bardin
f35625820a
Update website/docs/language/resources/terraform-data.mdx
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2023-02-14 14:10:07 -05:00
James Bardin
df65d16022 replace null_resource with terraform_data
Replace references to null_resource with terraform_data, and link the
use of terraform_data from replace_triggered_by.
2023-02-14 09:48:10 -05:00
James Bardin
3b953d3bd8 allow terraform_data to import
The terraform provider was panicking on import, because it didn't
previously have a resource type which could be imported at all. Add a
stub import function for terraform_data as a placeholder to allow the
call to complete successfully. While there's no need to actually import
a terraform_data resource, users will inevitably use this to construct
examples of import actions for learning purposes or bug reports.

This still isn't very useful even for examples however, because the
state-only nature of the terraform_data resource type means that we
can't fill in the state from only the import ID. This means that any
value in `trigger_replace` or `input` will cause a change in the next
plan. Once configuration data is available during import we can extend
this to create a logical final state based on config.
2023-02-14 09:37:21 -05:00