hashicorp / hashicorp/terraform-plugin-sdk
Log SDK Version Information
- Dominant language
- Go
- Stars
- 485
- Forks
- 244
- Avg merge
- 19h 57m
- Merged PRs (30d)
- 4
Description
### SDK version
```
v2.10.1
```
### Use-cases
Providers can be running a variety of SDK packages and versions. Similar to the Terraform CLI:
```text
2021-12-23T16:20:04.565-0500 [INFO] Terraform version: 1.1.2
```
It would be great to include SDK version information in the logging.
### Attempted Solutions
Asking folks after the fact which SDK version is involved, which might require spelunking which provider version was being used then which SDK version was being used with that provider version.
### Proposal
The [`meta.SDKVersionString`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/meta#SDKVersionString) is kept up to date with release version information. Use that to output an informational log:
```go
tfsdklog.Info(ctx, "terraform-plugin-sdk version: "+meta.SDKVersionString()))
```
### References
- https://github.com/hashicorp/terraform-plugin-go/issues/130
- https://github.com/hashicorp/terraform-plugin-framework/issues/238
Contributor guide
Research direction
Start by locating the SDK logging entry point that uses tfsdklog and inspect how meta.SDKVersionString is exposed. Add an informational log containing the SDK version, then verify that provider logs include the version in the proposed format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100