From 43eb9fc07962ed9df9fc75fbfa97793cbbed07de Mon Sep 17 00:00:00 2001 From: Robert Tomczak Date: Tue, 27 Dec 2022 22:27:47 +0100 Subject: [PATCH] Fix userSessionTimeoutAttr condition --- redshift/resource_redshift_user.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redshift/resource_redshift_user.go b/redshift/resource_redshift_user.go index 69bb3f6..ec0ba8f 100644 --- a/redshift/resource_redshift_user.go +++ b/redshift/resource_redshift_user.go @@ -224,7 +224,9 @@ func resourceRedshiftUserCreate(db *DBConnection, d *schema.ResourceData) error for _, opt := range intOpts { val := d.Get(opt.hclKey).(int) - if opt.hclKey != userSessionTimeoutAttr && val != 0 { + if opt.hclKey == userSessionTimeoutAttr && val != 0 { + createOpts = append(createOpts, fmt.Sprintf("%s %d", opt.sqlKey, val)) + } else if opt.hclKey != userSessionTimeoutAttr { createOpts = append(createOpts, fmt.Sprintf("%s %d", opt.sqlKey, val)) } }