From 13c63bc75682f7f2b47c11515b6aa74322003ff5 Mon Sep 17 00:00:00 2001 From: Aidan Melen <54326778+aidan-melen@users.noreply.github.com> Date: Thu, 8 Jun 2023 10:04:07 -0600 Subject: [PATCH 1/2] Update resource_connection_ssh_tunnel.go --- pkg/resources/resource_connection_ssh_tunnel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/resources/resource_connection_ssh_tunnel.go b/pkg/resources/resource_connection_ssh_tunnel.go index ec45e00c..3e1cb8f0 100644 --- a/pkg/resources/resource_connection_ssh_tunnel.go +++ b/pkg/resources/resource_connection_ssh_tunnel.go @@ -134,7 +134,7 @@ func connectionSshTunnelUpdate(ctx context.Context, d *schema.ResourceData, meta b := materialize.NewConnectionSshTunnelBuilder(meta.(*sqlx.DB), connectionName, schemaName, databaseName) - if d.HasChange("name") { + if d.HasChange("name") || d.HasChange("user") { _, newConnectionName := d.GetChange("name") b.Rename(newConnectionName.(string)) } From 2bd67bdc415fd883a4db33451132747c3d87866d Mon Sep 17 00:00:00 2001 From: Aidan Melen <54326778+aidan-melen@users.noreply.github.com> Date: Thu, 8 Jun 2023 10:08:53 -0600 Subject: [PATCH 2/2] Update resource_connection_ssh_tunnel.go force new `ssh_tunnel_connection` resource when `user` changes --- pkg/resources/resource_connection_ssh_tunnel.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/resources/resource_connection_ssh_tunnel.go b/pkg/resources/resource_connection_ssh_tunnel.go index 3e1cb8f0..a28c73c7 100644 --- a/pkg/resources/resource_connection_ssh_tunnel.go +++ b/pkg/resources/resource_connection_ssh_tunnel.go @@ -25,6 +25,7 @@ var connectionSshTunnelSchema = map[string]*schema.Schema{ Description: "The user of the SSH tunnel.", Type: schema.TypeString, Required: true, + ForceNew: true, }, "port": { Description: "The port of the SSH tunnel.", @@ -134,7 +135,7 @@ func connectionSshTunnelUpdate(ctx context.Context, d *schema.ResourceData, meta b := materialize.NewConnectionSshTunnelBuilder(meta.(*sqlx.DB), connectionName, schemaName, databaseName) - if d.HasChange("name") || d.HasChange("user") { + if d.HasChange("name") { _, newConnectionName := d.GetChange("name") b.Rename(newConnectionName.(string)) }