Skip to content
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

Add documentation for RequiredWith migration from SDKv2 to plugin framework #657

Closed
remyleone opened this issue Feb 7, 2023 · 4 comments · Fixed by #660
Closed

Add documentation for RequiredWith migration from SDKv2 to plugin framework #657

remyleone opened this issue Feb 7, 2023 · 4 comments · Fixed by #660
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@remyleone
Copy link
Contributor

Module version

...

Use-cases

Attempted Solutions

Proposal

References

@remyleone remyleone added the enhancement New feature or request label Feb 7, 2023
@bflad bflad added documentation Improvements or additions to documentation and removed enhancement New feature or request labels Feb 7, 2023
@bflad
Copy link
Contributor

bflad commented Feb 7, 2023

Hi @remyleone 👋 Thank you for raising this. If you have any specific suggestions, please let us know.

There's currently the SDK to framework migration guide, but once it gets to individual schema.Schema fields, the documentation does split up a little bit depending on what you're trying to do. For example with RequiredWith, it is mentioned on this migration page: https://developer.hashicorp.com/terraform/plugin/framework/migrating/attributes-blocks/validators-predefined

But it doesn't say the exact solutions available for that particular field:

@bendbennett do you think we should have https://developer.hashicorp.com/terraform/plugin/framework/migrating/attributes-blocks/fields and/or https://developer.hashicorp.com/terraform/plugin/framework/migrating/attributes-blocks/validators-predefined be a little bit more prescriptive about the mapping between the old and new? It may be useful to have tables, such as::

SDK Attribute Field Framework Attribute Validator Framework Resource Validator
ConflictsWith {TYPE}validator.ConflictsWith() resourcevalidator.Conflicting()

etc.

@remyleone
Copy link
Contributor Author

It would be advantageous to have a table that lists each field and how you should translate it into the framework. I've been looking around many pages to see how I should try out to translate a given pattern. In particular, having a linter tool that offers automated suggestions/helps even if it is very simplistic would help give confidence that it could be achieved. While waiting for an automated tool to appear a table would be very much appreciated and offer great help to map possible migration.

@bendbennett
Copy link
Contributor

bendbennett commented Feb 8, 2023

@bflad I agree that more prescriptive mapping would be useful. To this end I've added an issue for Add more prescriptive documentation for mapping between SDKv2 and the Framework and opened a related PR for Documentation for mapping between SDKv2 and the Framework. I'm happy to expand on this further if additional more prescriptive documentation is useful or desired.

@bflad bflad added this to the v1.2.0 milestone Feb 9, 2023
@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants