-
Notifications
You must be signed in to change notification settings - Fork 89
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
Feature/530/migrate to plugin framework #567
Feature/530/migrate to plugin framework #567
Conversation
Introduce mux and port the provider to v6.
Migrate data sources to terraform-provider-framework
…m-provider-framework
Migrate resource ec_deployment_traffic_filter_association to terraform-provider-framework
…ork-0.12 Update to terraform-plugin-framework 0.12 and fix import order
…ramework The behavior of the default_value plan_modifier changes, so it also applies default values when the value has been explicitly specified before. Unit test timeout increased. Switch to v6 provider in tests.
Migrate resource ec_deployment_traffic_filter to terraform-provider-framework
* Use ListNestedAttributes for nested schemas in datasource ec_stack * Use ListNestedAttributes for nested schemas in datasource ec_deployment * Use blocks and ListNestedAttributes for nested schemas in datasource ec_deployments
…ugin-framework (#10) Co-authored-by: Pascal Hofmann <[email protected]>
Update dependencies and remove external provider workaround from migration tests
#12) * Migrate resource ec_deployment_extension to terraform-plugin-framework * Remove useless use of ec.Bool() and ec.String() Co-authored-by: Pascal Hofmann <[email protected]>
💚 CLA has been signed |
It's not possible to import the elastic password, this feels like a pretty big foot gun that we're handing users. |
Yes, it's quite difficult to review this. We did some reviews with @pascal-hofmann when we were working on the feature branch and basically we followed the way that you proposed. But, even in that case, it's not so easy - |
Also, it means additional code changes to keep the provider working. As I said, we did this during the work on the feature branch. As an alternative, we can review the PRs on the migration repo - usually, it were a PR per resource/datasource. |
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.
Tiny way through this change.
…te-to-plugin-framework
As far as I know the CLA has been signed. I guess my comment will re-trigger the CLA check? |
@pascal-hofmann I can see you've signed the CLA, however it looks like these commits are using a different email address ( 2194ad3 @dimuon I guess you could reset the author on the above commits to use |
I've added the address to my github account. I don't think rewriting the commits is the right thing to do. (There is a company CLA signed with |
I've just rerun the checker. It looks good know 👍 |
I still would like to update the TF Framework to the latest version (v.1.1.1) before the merge. I've started working on this but it'll take some time - there are a number of breaking changes between 0.14.0 and 1.1.1. |
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.
LGTM. Some minor nits. Some cases where we should be following 'accept interfaces, return structs'
ec/ecdatasource/deploymentdatasource/flatteners_elasticsearch.go
Outdated
Show resolved
Hide resolved
ec/ecdatasource/deploymentdatasource/flatteners_elasticsearch.go
Outdated
Show resolved
Hide resolved
ec/ecresource/deploymentresource/elasticsearch/v2/node_roles_plan_modifier.go
Outdated
Show resolved
Hide resolved
ec/ecresource/deploymentresource/elasticsearch/v2/node_types_plan_modifier.go
Outdated
Show resolved
Hide resolved
I’ve updated the TF framework version till the latest one (v1.1.1) and came across a defect in the Framework that prevents us from releasing based on v1.1.1 (see our acceptance test failures - all errors with I plan to revert the latest commits that updates the Framework version and release the provider based on Framework v0.14.0 that was used during the development and was tested the most. We will update the TF Framework till v1.2.0 in the subsequent releases. |
This reverts commits * 06bf06e * 432ce9b We have to wait for a fix for hashicorp/terraform-plugin-framework#644. It should be in Framework v1.2.0.
This merge breaks datasources. Please undo or fix ASAP. |
@joelsdc , can you please provide more details? What is the error message? Also please share your configuration. |
@joelsdc , can you please also share the version of the Terraform CLI. |
Description
Migration to TF Plugin Framework.
New schema for
ec_deployment
.Limitations
ec_deployment
. The recommended way to port existing resources to the new provider version is state import.master
branch that were merged after the split (e.g. [feature] support template hardware migration API #487) in future releases.Review notes
The change is quite big. The alternative way to review the change is reviewing PRs in the migration repo. Usually, it was a PR per resource/datasource, e.g. this PR migrated
ec_deployment
. Also, mind the fact that there are a number of JSON files with resources for acceptance and unit tests that contributed to the size of the PR.Some design decisions were motivated by this TF issue that prevents from, e.g., using
Computed
+Optional
nested attributes with underlyingComputed
attributes (e.g.deploymentresource.elasticsearch.topology.autoscaling
is defined asRequired
while ideally it should beOptional
+Computed
).Also, the current TF core logic makes it nearly impossible to use sets with computed + optional underlying attributes that means, in particular, that Elasticsearch topology (where each tier has computed and optional attributes) cannot be represented using sets (
tfsdk.SetNestedAttributes
). More details:Related Issues
#506
#530
Motivation and Context
The change should resolve a number of Elasticsearch topology related issues in
ec_deployment
, e.g.#336, #445, #466, #467.
The Plugin Framework represents TF vision of the future of plugin development.
So the migration was a question of time that got a priority with the idea to resolve a number of mentioned topology related issues.
How Has This Been Tested?
There are 4 new acceptance tests that are disabled now. Prior to enabling them we need implement state upgrade for
ec_deployment
.Types of Changes
Readiness Checklist