84 Commits

Author SHA1 Message Date
Martin Atkins
0503163e28 tracing: Centralize our OpenTelemetry package imports
OpenTelemetry has various Go packages split across several Go modules that
often need to be carefully upgraded together. And in particular, we are
using the "semconv" package in conjunction with the OpenTelemetry SDK's
"resource" package in a way that requires that they both agree on which
version of the OpenTelemetry Semantic Conventions are being followed.

To help avoid "dependency hell" situations when upgrading, this centralizes
all of our direct calls into the OpenTelemetry SDK and tracing API into
packages under internal/tracing, by exposing a few thin wrapper functions
that other packages can use to access the same functionality indirectly.

We only use a relatively small subset of the OpenTelemetry library surface
area, so we don't need too many of these reexports and they should not
represent a significant additional maintenance burden.

For the semconv and resource interaction in particular this also factors
that out into a separate helper function with a unit test, so we should
notice quickly whenever they become misaligned. This complements the
end-to-end test previously added in opentofu/opentofu#3447 to give us
faster feedback about this particular problem, while the end-to-end test
has the broader scope of making sure there aren't any errors at all when
initializing OpenTelemetry tracing.

Finally, this also replaces the constants we previously had in package
traceaddrs with functions that return attribute.KeyValue values directly.
This matches the API style used by the OpenTelemetry semconv packages, and
makes the calls to these helpers from elsewhere in the system a little
more concise.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-10-30 13:27:10 -07:00
Christian Mesh
58b722c423 Fix OTEL init from semconv conflict (#3446)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-10-29 15:17:20 -04:00
Andrei Ciobanu
934be4ad5e Glossary - initial version (#3411)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-10-28 11:41:31 +02:00
Diógenes Fernandes
493f44ef76 Fix typos in the diagnostics.md docs (#3306)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-09-25 15:10:14 +01:00
Martin Atkins
604eeaf583 docs: Diagnostics Guide
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-09-24 07:42:15 -07:00
Christian Mesh
c10b4b2d03 Update provider for_each internal documentation (#2870)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-28 11:30:41 -04:00
Martin Atkins
e4fec9c6ca tfplugin5+tfplugin5: Adopt the latest protocol versions (#2817)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-19 07:00:49 -04:00
James Humphries
74272e079d Add tracing documentation (#2724)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2025-04-28 12:45:11 +01:00
Diógenes Fernandes
d2b0259819 fix: point link to tofu docs (#2707)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-04-24 16:39:34 -04:00
Martin Atkins
d6bfc31ecb tfplugin5+tfplugin6: Update to latest protocol schema
This commit adds the definitions of provider protocol 5.8 and 6.8 to our
archive of the historical protocol versions and then adopts each as the
current version of each of its major series.

These MPL-licensed schema definitions are from the plugin protocol server
implementation in this repository, copyright HashiCorp:
    https://github.com/hashicorp/terraform-plugin-go

The only modifications made are to change the "option go_package" directive
to match where the stubs need to be generated for OpenTofu, and to claim
copyright for that change and thus make the copyright header consistent
with what our pre-commit rules require.

The regeneration of the Go API stubs for the two major protocol versions
introduces some new fields and messages that OpenTofu does not yet support
but will happily ignore. Future work might make some use of these new
additions, but that's out of scope of this change that is intended only
to synchronize our protocol definition with what new plugin server releases
are likely to be linked against.

Compared to the previous minor releases of each series this only introduces
new fields to existing message types and does not define any new RPC
functions, so we don't need any changes to the "grpcwrap" and "mock_proto"
packages in this case.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-19 09:51:28 -07:00
Martin Atkins
d0d35d2dcd tfplugin5+tfplugin6: Update to latest protocol schema
This commit adds the definitions of provider protocol 5.6, 5.7, 6.6, and
6.7 to our archive of the historical protocol versions and then adopts
5.7 as the current version of major version 5 and 6.7 as the current
version of major version 6.

These MPL-licensed schema definitions are from the plugin protocol server
implementation in this repository, copyright HashiCorp:
    https://github.com/hashicorp/terraform-plugin-go

The only modifications made are to change the "option go_package" directive
to match where the stubs need to be generated for OpenTofu, and to claim
copyright for that change and thus make the copyright header consistent
with what our pre-commit rules require.

The regeneration of the Go API stubs for the two major protocol versions
introduces some new fields and messages that OpenTofu does not yet support
but will happily ignore. Future work might make some use of these new
additions, but that's out of scope of this change that is intended only
to synchronize our protocol definition with what new plugin server releases
are likely to be linked against.

This commit continues the existing precedent of having the stubs for the
newly-added interface methods in package grpcwrap being just a panicking
stub, which is how they will remain until a future project begins using
those methods in a way which requires them to be implemented, since
implementing the wrappers would require a deeper understanding of the
desired behavior of those methods.

It appears that we previously accepted a pull request to correct a typo
that originated in the older versions of the upstream protocol definitions,
but I have intentionally not forward-ported that here because it seems
clearer to keep these definitions as close as possible to their source
of truth from upstream, given that our current intention is to follow the
protocol as documented and not to change it.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-09 16:16:58 -08:00
Nathan Baulch
ea558d9d4b Fix typos (#1905)
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2024-08-29 13:20:33 -04:00
Christian Mesh
ed0c761b0e RFC #1042: Planning the implementation of static evaluation (#1649)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Co-authored-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Co-authored-by: James Humphries <James@james-humphries.co.uk>
Co-authored-by: Ronny Orot <ronny.orot@gmail.com>
Co-authored-by: Oleksandr Levchenkov <ollevche@gmail.com>
2024-06-12 09:21:32 -04:00
Oleksandr Levchenkov
8321f14786 fix: commands.go location in architecture docs (#1451)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-04-01 13:47:22 +03:00
Christian Mesh
63252aa2da Update to tfplugin proto 5.5 and 6.5 (#1435)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-03-26 14:36:26 -04:00
Janos
19a994ee7f Documentation updates for 1.7.0-alpha1 (state encryption) (#1396)
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
2024-03-14 15:05:05 +01:00
Christian Mesh
586c45fe5a Refactor encryption configuration (#1387)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-03-13 10:58:52 -04:00
Janos
fa638907f1 Fixes #1169: AES-GCM implementation (#1291)
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: James Humphries <James@james-humphries.co.uk>
Co-authored-by: James Humphries <jamesh@spacelift.io>
Co-authored-by: Serdar Dalgıç <serdardalgic@users.noreply.github.com>
Co-authored-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2024-03-07 10:24:37 +00:00
James Humphries
cbab4bee83 State Encryption Documentation and Partial Implementation (#1227)
Signed-off-by: StephanHCB <sbs_github_u43a@packetloss.de>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Signed-off-by: James Humphries <james@james-humphries.co.uk>
Co-authored-by: StephanHCB <sbs_github_u43a@packetloss.de>
Co-authored-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2024-02-16 14:59:19 +00:00
namgyalangmo
cb2e9119aa Update copyright notice (#1232)
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
2024-02-08 09:48:59 +00:00
RLRabinowitz
1b9148a3de Remove Terraform mentions in docs in the codebase (#713) 2023-10-12 12:11:01 +01:00
Elbaz
e5878055b6 Rename to opentofu docs and root folder (#529) 2023-09-21 12:53:02 +03:00
Yaron Yarimi
c8acedd885 Rename github.com/placeholderplaceholderplaceholder/opentf to github.com/opentofu/opentofu (#461) 2023-09-20 14:35:35 +03:00
Evgeniy Ivlev
8a1ec44073 Fix HTML link in contribution guide (#445) 2023-09-20 11:06:16 +03:00
Damian Stasik
a7d8cdd3ee Fix link in architecture.md (#271) 2023-09-05 18:06:26 +02:00
RLRabinowitz
11f19aa5e1 Remove all doc website doc images, adapt architecture-overview.png to new packages 2023-08-29 15:58:42 +03:00
RLRabinowitz
ddb7c4ba94 Changes links to internal/terraform in architecture.md 2023-08-28 14:22:57 +03:00
RLRabinowitz
cf1640bc10 Change terraform doc website links to be a placeholder for now 2023-08-27 15:11:45 +03:00
Yaron Yarimi
24beb7ee5c Renaming terraform to opentf 2023-08-22 15:45:05 +03:00
Yaron Yarimi
da56f706e7 Renaming of Terraform to OpenTF 2023-08-22 15:45:05 +03:00
Kuba Martin
ebcf7455eb Rename root module name. (#4)
* Rename module name from "github.com/hashicorp/terraform" to "github.com/placeholderplaceholderplaceholder/opentf".

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Gofmt.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Regenerate protobuf.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comments.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo issue and pull request link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo comment changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comment.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo some link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* make generate && make protobuf

Signed-off-by: Jakub Martin <kubam@spacelift.io>

---------

Signed-off-by: Jakub Martin <kubam@spacelift.io>
2023-08-17 14:45:11 +02:00
James Bardin
fb35d7fd89 add get_provider_schema_optional server capability 2023-07-10 10:59:15 -04:00
Martin Atkins
e0ef2748e6 docs: Describe the plugin protocol encoding of refined unknown values
This is actually a description of the "cty" library's encoding of refined
values, but from the perspective of the plugin protocol it's an
implementation detail that Terraform Core outsources that to a third-party
library, and current server-side implementations of the protocol use an
independent implementation of this format which will need to be compatible
with what cty does.
2023-05-24 13:48:16 -07:00
Craig Wright
ddd87994bf Update README.md
Fixing broken relative link path.
2023-05-02 16:23:40 -07:00
hashicorp-copywrite[bot]
325d18262e [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
Bilal
3901478212 Update README.md
added the right correction
2023-04-26 23:09:18 +02:00
Bilal
1ffe971a90 Update README.md
fix dead-link and change naming to have right understanding. (Add Peramlink instead of copy path)
2023-04-26 17:11:55 +02:00
kmoe
6fff41b6de Delete maintainer-etiquette.md (#32741) 2023-02-24 16:31:58 +00:00
Brian Flad
0b8c65fa4e docs: Explicitly mention Computed-only attribute behavior for Proposed New State
Reference: 21bb677db7/internal/plans/objchange/objchange.go (L289-L292)

Previously, the resource lifecycle documentation for Proposed New State only mentioned special behavior for Optional and Computed attributes. This minor documentation update mentions that Terraform also imposes special behavior on Computed-only attributes (preserving any Prior State value).
2023-01-10 14:50:02 -05:00
Martin Atkins
e293992d45 docs: "How Terraform Uses Unicode" should mention HCL too
I missed this on my first attempt to write this document. Consequently
we're currently depending on a version of HCL which uses Unicode 9, and
that's significantly lagging behind everything else which is currently on
Unicode 13.

My goal of adding these docs then is to remind us to update HCL to Unicode
15 once we're updating everything else to Unicode 15 with the Go 1.20
release, assuming that the Go team completes that Unicode upgrade as
currently planned.
2022-11-16 15:38:45 -08:00
Brian Flad
8c93420270 docs/plugin-protocol: Add notes about missing configuration in ReadResource and UpgradeResourceState request messages (#31998)
This opts to inline document these intentional design decisions in the protocol definition as a catch-all for it not being documented elsewhere.

Protocol Buffers files updated via:

```shell
make protobuf
```
2022-10-13 16:29:34 -04:00
Craig Wright
9854783d34 Merge pull request #31648 from nnzv/patch-3
typo: use destructions singular form
2022-08-16 15:17:38 -07:00
Enzo Venturi
235a8b7fcc typo: use destructions singular form 2022-08-16 01:21:32 -05:00
Enzo Venturi
467f1d32a0 doc: use american english
_Behaviour_ noun is standard in British English.
2022-08-16 01:17:18 -05:00
Laura Pacilio
aeefde7428 Merge pull request #31364 from timgates42/bugfix_typos
docs: Fix a few typos
2022-07-06 17:03:09 -04:00
James Bardin
26c569e384 s/Capabilities/ServerCapabilities/ 2022-07-06 13:47:35 -04:00
James Bardin
b9f1a5ac57 add Schema Capabilities to protocol 2022-07-06 13:47:35 -04:00
Tim Gates
dce91cafb4 docs: Fix a few typos
There are small typos in:
- docs/planning-behaviors.md
- docs/resource-instance-change-lifecycle.md
- website/README.md

Fixes:
- Should read `exhaustive` rather than `exhastive`.
- Should read `representation` rather than `repesentation`.
- Should read `preferably` rather than `preferrably`.
- Should read `absence` rather than `absense`.
2022-07-02 09:14:05 +10:00
Martin Atkins
543e5f4971 docs: "Resource Instance Change Lifecycle" revised
The previous version of this document was produced in haste in order to
support the development of the new provider framework, and so it focused
only on the most important details and left some of the operations totally
unmentioned.

This new version aims to capture the full set of managed-resource-related
provider operations, documenting when Terraform Core will call them and
what the provider ought to do in order to meet Terraform Core's
expectations for a valid response.

This new version does still assume a certain amount of knowledge on the
part of the reader about broadly what Terraform does from a user
perspective and what role providers play in that process. Perhaps a future
revision will include some additional background context as well, but
this is a snapshot of what I had time to do today between other work and
so for now I focused on presenting the remaining operations in a similar
amount of detail to what was here before.
2022-06-09 10:19:43 -07:00
Martin Atkins
e00f0804ef development docs: Planning Behaviors
For a while now we've had information equivalent to this in various
internal documents that we've referred to when designing features such as
config-driven refactoring, the "replace" planning option, and so forth.

However, so far we've not put that information in any sort of durable
public place that we can easily find and refer to when having design
discussions on GitHub and similar.

This is therefore an attempt to capture a summary of the three main design
patterns we've identified for planning-related behaviors, with a few
motivating examples of each one, in the hope that this will be a good
reference and some helpful inspiration for future design work.

It's intentionally not totally comprehensive of all planning behaviors
both because that would duplicate the end-user-oriented documentation and
because it would be burdensome to keep updating this document each time we
add anything new which might fit into these categories. However, we might
add a later feature to this document if it illustrates a new take or
different perspective on one of these patterns.
2022-06-02 10:56:29 -07:00