diff --git a/CHANGELOG.md b/CHANGELOG.md index d3fbdd66..f0639596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.0...HEAD) +## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.1...HEAD) + +## [1.2.1](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.0...v1.2.1) + +## Fixed + +Issue with upgrade `fivetran_connector` resource state on version upgrade. ## [1.2.0](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.1.27...v1.2.0) diff --git a/fivetran/framework/provider.go b/fivetran/framework/provider.go index 1bf0239b..bb4043da 100644 --- a/fivetran/framework/provider.go +++ b/fivetran/framework/provider.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -const Version = "1.2.0" // Current provider version +const Version = "1.2.1" // Current provider version type fivetranProvider struct { mockClient httputils.HttpClient diff --git a/fivetran/framework/resources/connector_migrations.go b/fivetran/framework/resources/connector_migrations.go index 83547a97..5369aea8 100644 --- a/fivetran/framework/resources/connector_migrations.go +++ b/fivetran/framework/resources/connector_migrations.go @@ -38,13 +38,16 @@ func upgradeConnectorState(ctx context.Context, req resource.UpgradeStateRequest dynamicValue, err := tfprotov6.NewDynamicValue( getConnectorStateModel(3), tftypes.NewValue(getConnectorStateModel(3), map[string]tftypes.Value{ - "id": rawState["id"], - "name": rawState["name"], - "connected_by": rawState["connected_by"], - "created_at": rawState["created_at"], - "group_id": rawState["group_id"], - "service": rawState["service"], - "timeouts": rawState["timeouts"], + "id": rawState["id"], + "name": rawState["name"], + "connected_by": rawState["connected_by"], + "created_at": rawState["created_at"], + "group_id": rawState["group_id"], + "service": rawState["service"], + "timeouts": rawState["timeouts"], + "networking_method": tftypes.NewValue(tftypes.String, nil), + "proxy_agent_id": tftypes.NewValue(tftypes.String, nil), + "local_processing_agent_id": tftypes.NewValue(tftypes.String, nil), "run_setup_tests": convertStringStateValueToBool("run_setup_tests", rawState["run_setup_tests"], resp.Diagnostics), "trust_fingerprints": convertStringStateValueToBool("trust_fingerprints", rawState["trust_fingerprints"], resp.Diagnostics), @@ -101,7 +104,8 @@ func getConnectorStateModel(version int) tftypes.Type { base["proxy_agent_id"] = tftypes.String base["networking_method"] = tftypes.String - + base["local_processing_agent_id"] = tftypes.String + base["config"] = tftypes.Object{AttributeTypes: model.GetTfTypes(common.GetConfigFieldsMap(), 3)} base["auth"] = tftypes.Object{AttributeTypes: model.GetTfTypes(common.GetAuthFieldsMap(), 3)} } else {