diff --git a/.changelog/35736.txt b/.changelog/35736.txt new file mode 100644 index 000000000000..70b588cb4d1f --- /dev/null +++ b/.changelog/35736.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_eks_access_policy_association: Retry IAM eventual consistency errors on create +``` \ No newline at end of file diff --git a/internal/service/eks/access_policy_association.go b/internal/service/eks/access_policy_association.go index e7c532178b31..be91b69eca6c 100644 --- a/internal/service/eks/access_policy_association.go +++ b/internal/service/eks/access_policy_association.go @@ -111,7 +111,9 @@ func resourceAccessPolicyAssociationCreate(ctx context.Context, d *schema.Resour PrincipalArn: aws.String(principalARN), } - _, err := conn.AssociateAccessPolicy(ctx, input) + _, err := tfresource.RetryWhenIsAErrorMessageContains[*types.ResourceNotFoundException](ctx, propagationTimeout, func() (interface{}, error) { + return conn.AssociateAccessPolicy(ctx, input) + }, "The specified principalArn could not be found") if err != nil { return sdkdiag.AppendErrorf(diags, "creating EKS Access Policy Association (%s): %s", id, err)