Skip to content

Commit

Permalink
Delete comment
Browse files Browse the repository at this point in the history
  • Loading branch information
atsushi-ishibashi committed Feb 22, 2018
1 parent b2db759 commit bda7048
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions aws/resource_aws_cognito_user_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
UserPoolId: aws.String(d.Id()),
}

//if d.HasChange
if v, ok := d.GetOk("admin_create_user_config"); ok {
configs := v.([]interface{})
config, ok := configs[0].(map[string]interface{})
Expand All @@ -698,13 +697,10 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
}
}

//if d.HasChange("auto_verified_attributes") {
if v, ok := d.GetOk("auto_verified_attributes"); ok {
params.AutoVerifiedAttributes = expandStringList(v.(*schema.Set).List())
}
//}

//if d.HasChange("device_configuration") {
if v, ok := d.GetOk("device_configuration"); ok {
configs := v.([]interface{})
config, ok := configs[0].(map[string]interface{})
Expand All @@ -713,7 +709,6 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
params.DeviceConfiguration = expandCognitoUserPoolDeviceConfiguration(config)
}
}
//}

if v, ok := d.GetOk("email_configuration"); ok {
configs := v.([]interface{})
Expand All @@ -734,7 +729,6 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
}
}

//if d.HasChange("email_verification_subject") {
if v, ok := d.GetOk("email_verification_subject"); ok {

// This is to prevent removing default message since the API disallows it
Expand All @@ -743,17 +737,14 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
}
params.EmailVerificationSubject = aws.String(v.(string))
}
//}

//if d.HasChange("email_verification_message") {
if v, ok := d.GetOk("email_verification_message"); ok {
// This is to prevent removing default message since the API disallows it
if v.(string) == "" {
return errors.New("email_verification_message cannot be set to nil")
}
params.EmailVerificationMessage = aws.String(v.(string))
}
//}

if v, ok := d.GetOk("lambda_config"); ok {
configs := v.([]interface{})
Expand All @@ -764,11 +755,9 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
}
}

//if d.HasChange("mfa_configuration") {
if v, ok := d.GetOk("mfa_configuration"); ok {
params.MfaConfiguration = aws.String(v.(string))
}
//}

if v, ok := d.GetOk("password_policy"); ok {
configs := v.([]interface{})
Expand All @@ -781,13 +770,10 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
}
}

//if d.HasChange("sms_authentication_message") {
if v, ok := d.GetOk("sms_authentication_message"); ok {
params.SmsAuthenticationMessage = aws.String(v.(string))
}
//}

//if d.HasChange("sms_configuration") {
if v, ok := d.GetOk("sms_configuration"); ok {
configs := v.([]interface{})
config, ok := configs[0].(map[string]interface{})
Expand All @@ -796,9 +782,7 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
params.SmsConfiguration = expandCognitoUserPoolSmsConfiguration(config)
}
}
//}

//if d.HasChange("verification_message_template") {
if v, ok := d.GetOk("verification_message_template"); ok {
configs := v.([]interface{})
config, ok := configs[0].(map[string]interface{})
Expand All @@ -807,17 +791,14 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{})
params.VerificationMessageTemplate = expandCognitoUserPoolVerificationMessageTemplate(config)
}
}
//}

//if d.HasChange("sms_verification_message") {
if v, ok := d.GetOk("sms_verification_message"); ok {
// This is to prevent removing default message since the API disallows it
if v.(string) == "" {
return errors.New("sms_verification_message cannot be set to nil")
}
params.SmsVerificationMessage = aws.String(v.(string))
}
//}

if v, ok := d.GetOk("tags"); ok {
params.UserPoolTags = tagsFromMapGeneric(v.(map[string]interface{}))
Expand Down

0 comments on commit bda7048

Please sign in to comment.