diff --git a/.changelog/39429.txt b/.changelog/39429.txt new file mode 100644 index 00000000000..84a5ae3a005 --- /dev/null +++ b/.changelog/39429.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_iam_role: Retry `ConcurrentModificationException`s during role creation +``` diff --git a/internal/service/iam/role.go b/internal/service/iam/role.go index 4b58c37efee..3a95e9f3d42 100644 --- a/internal/service/iam/role.go +++ b/internal/service/iam/role.go @@ -601,6 +601,9 @@ func retryCreateRole(ctx context.Context, conn *iam.Client, input *iam.CreateRol if errs.IsAErrorMessageContains[*awstypes.MalformedPolicyDocumentException](err, "Invalid principal in policy") { return true, err } + if errs.IsA[*awstypes.ConcurrentModificationException](err) { + return true, err + } return false, err },