diff --git a/internal/provider/instance_resource.go b/internal/provider/instance_resource.go index b34abec..fb75ae9 100644 --- a/internal/provider/instance_resource.go +++ b/internal/provider/instance_resource.go @@ -435,9 +435,9 @@ func restoreInstance(plan temboInstanceResourceModel, restoreInstance.SetExtraDomainsRw(getStringArray(plan.ExtraDomainsRw)) - /*if plan.ConnectionPooler != nil { + if plan.ConnectionPooler != nil { restoreInstance.SetConnectionPooler(*getConnectionPooler(plan.ConnectionPooler)) - }*/ + } ctx = context.WithValue(ctx, temboclient.ContextAccessToken, r.temboInstanceConfig.accessToken) @@ -628,11 +628,6 @@ func setTemboInstanceResourceModel(instanceResourceModel *temboInstanceResourceM instanceResourceModel.ExtraDomainsRw = localExtraDomainsRw } - // Restore Mode only sets above fields so skipping the other fields. - if isRestoreMode { - return - } - if instance.ConnectionPooler.Get() != nil { var localConnectionPooler ConnectionPooler cp := instance.ConnectionPooler.Get() @@ -642,6 +637,11 @@ func setTemboInstanceResourceModel(instanceResourceModel *temboInstanceResourceM instanceResourceModel.ConnectionPooler = &localConnectionPooler } + // Restore Mode only sets above fields so skipping the other fields. + if isRestoreMode { + return + } + instanceResourceModel.StackType = types.StringValue(string(instance.StackType)) instanceResourceModel.Replicas = types.Int64Value(int64(instance.GetReplicas()))