Skip to content

Commit

Permalink
Fix userSessionTimeoutAttr condition
Browse files Browse the repository at this point in the history
  • Loading branch information
robertomczak committed Dec 28, 2022
1 parent 86a6785 commit 43eb9fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redshift/resource_redshift_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down

0 comments on commit 43eb9fc

Please sign in to comment.