Skip to content

Commit

Permalink
Consistentize and correct log and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Feb 18, 2022
1 parent baf52bb commit 7b1c89a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion internal/service/iam/instance_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func resourceInstanceProfileCreate(d *schema.ResourceData, meta interface{}) err
}

if err != nil {
return fmt.Errorf("error updating tags for IAM Instance Profile (%s): %w", d.Id(), err)
return fmt.Errorf("failed adding tags after create for IAM Instance Profile (%s): %w", d.Id(), err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/service/iam/openid_connect_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func resourceOpenIDConnectProviderCreate(d *schema.ResourceData, meta interface{
}

if err != nil {
return fmt.Errorf("error updating tags for IAM OIDC Provider (%s): %w", d.Id(), err)
return fmt.Errorf("failed adding tags after create for IAM OIDC Provider (%s): %w", d.Id(), err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/service/iam/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func resourcePolicyCreate(d *schema.ResourceData, meta interface{}) error {
}

if err != nil {
return fmt.Errorf("error updating tags for IAM Policy (%s): %w", d.Id(), err)
return fmt.Errorf("failed adding tags after create for IAM Policy (%s): %w", d.Id(), err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/service/iam/saml_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func resourceSAMLProviderCreate(d *schema.ResourceData, meta interface{}) error
}

if err != nil {
return fmt.Errorf("error updating tags for IAM SAML Provider (%s): %w", d.Id(), err)
return fmt.Errorf("failed adding tags after create for IAM SAML Provider (%s): %w", d.Id(), err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/service/iam/server_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func resourceServerCertificateCreate(d *schema.ResourceData, meta interface{}) e
}

if err != nil {
return fmt.Errorf("error updating tags for IAM Server Certificate (%s): %w", d.Id(), err)
return fmt.Errorf("failed adding tags after create for IAM Server Certificate (%s): %w", d.Id(), err)
}
}

Expand Down
6 changes: 3 additions & 3 deletions internal/service/iam/service_linked_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func resourceServiceLinkedRoleCreate(d *schema.ResourceData, meta interface{}) e
}

if err != nil {
return fmt.Errorf("error updating IAM Service Linked Role (%s) tags: %w", d.Id(), err)
return fmt.Errorf("failed adding tags after create for IAM Service Linked Role (%s): %w", d.Id(), err)
}
}

Expand Down Expand Up @@ -208,12 +208,12 @@ func resourceServiceLinkedRoleUpdate(d *schema.ResourceData, meta interface{}) e

// If default tags only, log and continue. Otherwise, error.
if v, ok := d.GetOk("tags"); (!ok || len(v.(map[string]interface{})) == 0) && verify.CheckISOErrorTagsUnsupported(err) {
log.Printf("[WARN] failed adding tags after create for IAM Service Linked Role (%s): %s", d.Id(), err)
log.Printf("[WARN] failed updating tags for IAM Service Linked Role (%s): %s", d.Id(), err)
return resourceServiceLinkedRoleRead(d, meta)
}

if err != nil {
return fmt.Errorf("error updating IAM Service Linked Role (%s) tags: %w", d.Id(), err)
return fmt.Errorf("failed updating tags for IAM Service Linked Role (%s): %w", d.Id(), err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/service/iam/virtual_mfa_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func resourceVirtualMFADeviceCreate(d *schema.ResourceData, meta interface{}) er
}

if err != nil {
return fmt.Errorf("error updating tags for IAM Virtual MFA Device (%s): %w", d.Id(), err)
return fmt.Errorf("failed adding tags after create for IAM Virtual MFA Device (%s): %w", d.Id(), err)
}
}

Expand Down Expand Up @@ -172,7 +172,7 @@ func resourceVirtualMFADeviceUpdate(d *schema.ResourceData, meta interface{}) er
}

if err != nil {
return fmt.Errorf("error updating tags for IAM Virtual MFA Device (%s): %w", d.Id(), err)
return fmt.Errorf("failed updating tags for IAM Virtual MFA Device (%s): %w", d.Id(), err)
}

return resourceVirtualMFADeviceRead(d, meta)
Expand Down

0 comments on commit 7b1c89a

Please sign in to comment.