Skip to content

Commit

Permalink
Merge pull request #4 from better/small-fix-naming
Browse files Browse the repository at this point in the history
bug fix: wrong key name
  • Loading branch information
Vitaly Sergeyev authored Oct 20, 2020
2 parents e7afeeb + fe9a293 commit dc0f7f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions redshift/resource_redshift_user_password_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func getId(d *schema.ResourceData) string {
ids := []string{
d.Get("name").(string),
d.Get("user").(string),
d.Get("secret_id").(string),
}

Expand Down Expand Up @@ -66,7 +66,7 @@ func resourceRedshiftUserPasswordAssociation() *schema.Resource {
func resourceRedshiftUserPasswordAssociationCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics

name := d.Get("name").(string)
username := d.Get("user").(string)
secretId := d.Get("secret_id").(string)
password, err := getPassword(secretId, getSession())

Expand All @@ -83,7 +83,7 @@ func resourceRedshiftUserPasswordAssociationCreate(ctx context.Context, d *schem
}


alterPasswordStatement := fmt.Sprintf("ALTER USER %s PASSWORD '%s'", name, password)
alterPasswordStatement := fmt.Sprintf("ALTER USER %s PASSWORD '%s'", username, password)
if _, alterPasswordrErr := tx.Exec(alterPasswordStatement); alterPasswordrErr != nil {
log.Println("error | resourceRedshiftUserPasswordAssociationCreate | alterPasswordrErr |", alterPasswordrErr)
tx.Rollback()
Expand Down

0 comments on commit dc0f7f6

Please sign in to comment.