From ecb4ff9089473f738c9828d6ef97db425f51e833 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 13 Sep 2023 16:39:54 -0400 Subject: [PATCH 1/3] aws_dms_replication_task: allow removal of replication_task_settings --- internal/service/dms/replication_task.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/service/dms/replication_task.go b/internal/service/dms/replication_task.go index fc051eef743..f5d41bc77a3 100644 --- a/internal/service/dms/replication_task.go +++ b/internal/service/dms/replication_task.go @@ -235,7 +235,11 @@ func resourceReplicationTaskUpdate(ctx context.Context, d *schema.ResourceData, } if d.HasChange("replication_task_settings") { - input.ReplicationTaskSettings = aws.String(d.Get("replication_task_settings").(string)) + if v, ok := d.GetOk("replication_task_settings"); ok { + input.ReplicationTaskSettings = aws.String(v.(string)) + } else { + input.ReplicationTaskSettings = nil + } } status := d.Get("status").(string) From 34c5ab71f7e24f286b8c2be0332341dfb0533d99 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 13 Sep 2023 17:30:08 -0400 Subject: [PATCH 2/3] aws_dms_replication_task: allow removal of replication_task_settings --- internal/service/dms/replication_task.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/dms/replication_task.go b/internal/service/dms/replication_task.go index f5d41bc77a3..462f71b4c4e 100644 --- a/internal/service/dms/replication_task.go +++ b/internal/service/dms/replication_task.go @@ -235,8 +235,8 @@ func resourceReplicationTaskUpdate(ctx context.Context, d *schema.ResourceData, } if d.HasChange("replication_task_settings") { - if v, ok := d.GetOk("replication_task_settings"); ok { - input.ReplicationTaskSettings = aws.String(v.(string)) + if v, ok := d.Get("replication_task_settings").(string); ok && v != "" { + input.ReplicationTaskSettings = aws.String(v) } else { input.ReplicationTaskSettings = nil } From 99a9b31b1bbbcb28e55dc1177e628b7eaa048bd7 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 13 Sep 2023 17:44:47 -0400 Subject: [PATCH 3/3] add CHANGELOG entry --- .changelog/33456.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/33456.txt diff --git a/.changelog/33456.txt b/.changelog/33456.txt new file mode 100644 index 00000000000..0414c4ff9c6 --- /dev/null +++ b/.changelog/33456.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_dms_replication_task: Fix error when `replication_task_settings` is `nil` +``` \ No newline at end of file