Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_iam_policy_attachment: Fixes for tfproviderlint R006 (#1…
…2043) Reference: #11864 `RetryFunc` should only be used when logic has a retryable condition. In the case of working with the AWS Go SDK, it also arbitrarily restricts the automatic retrying logic of API calls to the timeout, which is generally undesired. This particular case looks like the original intent was to verify via read-after-write that the appropriate write was persisted, however the logic errantly returned `return resource.NonRetryableError()` with `nil` when the role policy was not found, ending the `RetryFunc` without an actual error and never retrying on any condition. Previously: ``` aws/resource_aws_iam_policy_attachment.go:220:53: R006: RetryFunc should include RetryableError() handling or be removed ``` Output from acceptance testing: ``` --- PASS: TestAccAWSIAMPolicyAttachment_Groups_RenamedGroup (22.54s) --- PASS: TestAccAWSIAMPolicyAttachment_Users_RenamedUser (23.00s) --- PASS: TestAccAWSIAMPolicyAttachment_Roles_RenamedRole (24.95s) --- PASS: TestAccAWSIAMPolicyAttachment_basic (39.85s) --- PASS: TestAccAWSIAMPolicyAttachment_paginatedEntities (242.04s) ```
- Loading branch information