-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to TF SDKv2 #14432
Upgrade to TF SDKv2 #14432
Conversation
@bflad I seem to have upset the linter, any chance I can get an assist on making that happy? I thought upgrading the import path to V2 SDK would be all I need. |
@appilon my presumption is that tfproviderlint (used by awsproviderlint) will need to be updated to support the new module paths (github.com/hashicorp/terraform-plugin-sdk/... versus github.com/hashicorp/terraform-plugin-sdk/v2/...). Created a tracking issue here: bflad/tfproviderlint#178 |
tfproviderlint v0.15.0 has been merged with SDK v2 support -- hopefully a rebase will resolve that particular issue. 🤞 |
c6e0960
to
1c18c4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through the file diffs now, but dropping this here so it can be done before I'm done.
@@ -35,6 +35,30 @@ behavior "deprecated_import_commenter" "hashicorp_terraform" { | |||
EOF | |||
} | |||
|
|||
behavior "deprecated_import_commenter" "sdkv1" { | |||
import_regexp = "github.com/hashicorp/terraform-plugin-sdk/helper/(schema|resource|acctest)" | |||
marker_label = "terraform-plugin-sdk-v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add this new label in infrastructure/repository/labels-workflow.tf
(using same color as the other label)?
Co-authored-by: Brian Flad <bflad417@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it. 🚀
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
At long at last. Please note importing V1 of the SDK is still present for some helper packages in V1 (
encrypt
,hashcode
, etc). The official recommendation is to internalize these packages or find better maintained third party libraries. I will follow up with internalizing these dependencies.The two go modules can be imported side by side cleanly because the helper packages are "leaf" packages and don't intermix with the types throughout the SDK codebase. HOWEVER, be wary that your editor may choose to import V1 of the SDK when creating a new resource. This will result in an odd compilation error with something along the lines of
cannot use type *schema.Provider as *schema.Provider
, the reason of course is theprovider.go
file has been migrated to V2 SDK and is expecting V2 SDK namespaced types.This annoyance will go away once the V1 dependency is removed
Community Note
Closed #12087
Release note for CHANGELOG:
Output from acceptance testing:
No significant error rate increase or runtime increase!