-
Notifications
You must be signed in to change notification settings - Fork 121
Migrate Elasticsearch enrich policy resource and data source to Terraform Plugin Framework #1220
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
Conversation
…ata source Co-authored-by: tobio <[email protected]>
Co-authored-by: tobio <[email protected]>
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.
You'll need to remove the old SDK based code as well.
|
@copilot make sure that |
…mentation Co-authored-by: tobio <[email protected]>
Done! Removed all old SDK v2 files (policy.go, policy_data_source.go, policy_test.go, policy_data_source_test.go) and their references from provider.go. Commit 724c139 |
Co-authored-by: tobio <[email protected]>
Co-authored-by: tobio <[email protected]>
Both |
…ad logic Co-authored-by: tobio <[email protected]>
…es, fix test assertion Co-authored-by: tobio <[email protected]>
…description Co-authored-by: tobio <[email protected]>
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.
make lint is failing as the docs weren't updated as part of the change to a SetAttribute. Run make docs-generate and commit the result.
…ttribute Co-authored-by: tobio <[email protected]>
Documentation has been updated by running |
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 👍
* origin/main: Migrate Elasticsearch enrich policy resource and data source to Terraform Plugin Framework (#1220) Add support for solution field in elasticsearch_kibana_space resource and data source (#1210) Don't force replacement when changing integration versions (#1255) chore(deps): update golang:1.25.0 docker digest to 5502b0e (#1267) chore(deps): update docker.elastic.co/kibana/kibana docker tag to v9.1.3 (#1263) Bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14 (#1264) Migrate Kibana connectors to use the bundled openapi generated client (#1260) Extend CONTRIBUTING.md (#1262) fix: add `namespace` attribute to `elasticstack_kibana_synthetics_monitor` resource (#1247) Bump github.com/stretchr/testify from 1.10.0 to 1.11.0 (#1261) chore(deps): update codecov/codecov-action digest to fdcc847 (#1258) fix(deps): update module go.uber.org/mock to v0.6.0 (#1259)
* origin/main: Somehow I didn't merge this properly... (#1273) fix(deps): update module github.com/stretchr/testify to v1.11.1 (#1272) Migrate to terraform-plugin-testing (#1256) Migrate Elasticsearch enrich policy resource and data source to Terraform Plugin Framework (#1220) Add support for solution field in elasticsearch_kibana_space resource and data source (#1210) Don't force replacement when changing integration versions (#1255) chore(deps): update golang:1.25.0 docker digest to 5502b0e (#1267) chore(deps): update docker.elastic.co/kibana/kibana docker tag to v9.1.3 (#1263) Bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14 (#1264)
This PR migrates the
elasticstack_elasticsearch_enrich_policyresource and data source from Terraform SDK v2 to the Terraform Plugin Framework, following the established pattern used in the system user migration.Changes
New Plugin Framework Implementation:
internal/elasticsearch/enrich/Key Files Added:
resource.go- Main resource and data source definitionsschema.go- Plugin Framework schema with proper validatorsmodels.go- Framework data modelscreate.go- Create/Update operationsread.go- Read operations for both resource and data sourcedelete.go- Delete operationsacc_test.go- Plugin Framework acceptance tests including legacy migration testProvider Integration:
provider/plugin_framework.goTesting:
TestAccResourceEnrichPolicyFromSDKtest to verify legacy resource migrationThe migration maintains full backward compatibility while providing the benefits of the Plugin Framework including better type safety, improved validation, and enhanced developer experience.
Fixes #1219.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.