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

Migrate to Terraform Plugin Framework #180

Open
matifali opened this issue Jan 8, 2024 · 2 comments
Open

Migrate to Terraform Plugin Framework #180

matifali opened this issue Jan 8, 2024 · 2 comments
Milestone

Comments

@matifali
Copy link
Member

matifali commented Jan 8, 2024

Terraform recommends migrating to Terraform Plugins Framework as it provides some benefits over the SDKv2.

  1. https://developer.hashicorp.com/terraform/plugin/framework-benefits/
  2. https://developer.hashicorp.com/terraform/plugin/framework/migrating/benefits

Docs

Terraform Plugin Framework
Develop Terraform providers using the recommended plugin framework.

The plugin framework is HashiCorp’s recommended way develop Terraform Plugins on protocol version 6 or protocol version 5.

We recommend using the framework to develop new providers because it offers significant advantages as compared to Terraform Plugin SDKv2. We also recommend migrating existing providers to the framework when possible. Refer to Plugin Framework Benefits for higher level details about how the framework makes provider development easier and Plugin Framework Features for a detailed functionality comparison between the SDKv2 and the framework.

Get Started

Try the Terraform Plugin Framework tutorials.
Clone the terraform-provider-scaffolding-framework template repository on GitHub.

Migration steps

Take the following steps when you migrate a provider from SDKv2 to the Framework:

  1. Ensure all tests pass.
  2. Consider finding SDKv2 resource data consistency errors, which might affect migrating to the Framework. Some errors can be resolved and verified with SDKv2 code before migration, if desired, otherwise resolving these errors must be part of the migration.
  3. Serve the provider via the Framework.
    1. Implement muxing, if you plan to migrate the provider iteratively.
  4. Update the provider definition to use the Framework.
  5. Update the provider schema.
  6. Update each of the provider's resources and data sources.
    1. Update related tests to use the Framework, and ensure that the tests fail.
    2. Migrate the resource or data source.
    3. Verify that related tests now pass.
  7. If you used muxing, remove the muxing configuration.

Depends on #222

@matifali matifali changed the title Migrate to Terraform Plugin Framework Migrate to [Terraform Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework) Jan 8, 2024
@matifali matifali changed the title Migrate to [Terraform Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework) Migrate to Terraform Plugin Framework Jan 8, 2024
@bpmct
Copy link
Member

bpmct commented May 6, 2024

I don't really understand the benefit of us doing this

@matifali
Copy link
Member Author

matifali commented May 6, 2024

@bpmct They may probably deprecate the sdk v2 anytime.

SDKv2 is the prior SDK that many existing providers use. It is maintained for Terraform versions 1.x and earlier, but we have stopped most feature development so we can focus on improving the framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants