From 7b1c89ac96a6ea5d0737df1e0dbe387af8483b3f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 18 Feb 2022 17:29:32 -0500 Subject: [PATCH] Consistentize and correct log and error messages --- internal/service/iam/instance_profile.go | 2 +- internal/service/iam/openid_connect_provider.go | 2 +- internal/service/iam/policy.go | 2 +- internal/service/iam/saml_provider.go | 2 +- internal/service/iam/server_certificate.go | 2 +- internal/service/iam/service_linked_role.go | 6 +++--- internal/service/iam/virtual_mfa_device.go | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/iam/instance_profile.go b/internal/service/iam/instance_profile.go index b1dd9e4bed7..1270b92f1ad 100644 --- a/internal/service/iam/instance_profile.go +++ b/internal/service/iam/instance_profile.go @@ -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) } } diff --git a/internal/service/iam/openid_connect_provider.go b/internal/service/iam/openid_connect_provider.go index 0ff7418fe22..2fb94eba23e 100644 --- a/internal/service/iam/openid_connect_provider.go +++ b/internal/service/iam/openid_connect_provider.go @@ -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) } } diff --git a/internal/service/iam/policy.go b/internal/service/iam/policy.go index 9efa32e5661..da8e4f0f80e 100644 --- a/internal/service/iam/policy.go +++ b/internal/service/iam/policy.go @@ -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) } } diff --git a/internal/service/iam/saml_provider.go b/internal/service/iam/saml_provider.go index f9652c6dd1f..6632c84d962 100644 --- a/internal/service/iam/saml_provider.go +++ b/internal/service/iam/saml_provider.go @@ -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) } } diff --git a/internal/service/iam/server_certificate.go b/internal/service/iam/server_certificate.go index 7cee181a56a..3d065c35524 100644 --- a/internal/service/iam/server_certificate.go +++ b/internal/service/iam/server_certificate.go @@ -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) } } diff --git a/internal/service/iam/service_linked_role.go b/internal/service/iam/service_linked_role.go index da44793cb5b..404e421e913 100644 --- a/internal/service/iam/service_linked_role.go +++ b/internal/service/iam/service_linked_role.go @@ -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) } } @@ -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) } } diff --git a/internal/service/iam/virtual_mfa_device.go b/internal/service/iam/virtual_mfa_device.go index 0ae42753081..1dfbf5b2ea9 100644 --- a/internal/service/iam/virtual_mfa_device.go +++ b/internal/service/iam/virtual_mfa_device.go @@ -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) } } @@ -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)