<p>Was trying to integrate GitLab 13.3.2 CE (deployed on On-Prem server) with EKS.</p>
<p><a href="https://i.stack.imgur.com/mJp4n.png" rel="nofollow noreferrer">First I provided the Account ID, Access Key and Secret Key. (Admin Area -&gt; Settings -&gt; Integrations) Also Enabled EKS Integration.</a></p>
<p>Secondly I created an IAM role in the respective account with the policies mentioned in the link specified. (<a href="https://docs.gitlab.com/ce/user/project/clusters/add_eks_clusters.html" rel="nofollow noreferrer">https://docs.gitlab.com/ce/user/project/clusters/add_eks_clusters.html</a>) Followed all the steps mentioned in this link meticulously.</p>
<p>Policy attached to the aws iam role,</p>
<p>Following were the steps to create the IAM Role,</p>
<ol>
<li>Logged in to IAM Console</li>
<li>Clicked on Roles section in the left menu.</li>
<li>Select Type of Trusted Entity as &quot;Another AWS account&quot;</li>
<li>Filled in the Account ID</li>
<li>Provided the External ID mentioned in GitLab Project's Kubernetes console</li>
</ol>
<p><a href="https://i.stack.imgur.com/XNnau.png" rel="nofollow noreferrer">Clicked on the Respective Project, Operations -&gt; Kubernetes -&gt; Add Kubernetes Cluster -&gt; Create New Cluster on <strong>Amazon EKS</strong></a></p>
<pre><code>{
    &quot;Version&quot;: &quot;2012-10-17&quot;,
    &quot;Statement&quot;: [
        {
            &quot;Effect&quot;: &quot;Allow&quot;,
            &quot;Action&quot;: [
                &quot;autoscaling:CreateAutoScalingGroup&quot;,
                &quot;autoscaling:DescribeAutoScalingGroups&quot;,
                &quot;autoscaling:DescribeScalingActivities&quot;,
                &quot;autoscaling:UpdateAutoScalingGroup&quot;,
                &quot;autoscaling:CreateLaunchConfiguration&quot;,
                &quot;autoscaling:DescribeLaunchConfigurations&quot;,
                &quot;cloudformation:CreateStack&quot;,
                &quot;cloudformation:DescribeStacks&quot;,
                &quot;ec2:AuthorizeSecurityGroupEgress&quot;,
                &quot;ec2:AuthorizeSecurityGroupIngress&quot;,
                &quot;ec2:RevokeSecurityGroupEgress&quot;,
                &quot;ec2:RevokeSecurityGroupIngress&quot;,
                &quot;ec2:CreateSecurityGroup&quot;,
                &quot;ec2:createTags&quot;,
                &quot;ec2:DescribeImages&quot;,
                &quot;ec2:DescribeKeyPairs&quot;,
                &quot;ec2:DescribeRegions&quot;,
                &quot;ec2:DescribeSecurityGroups&quot;,
                &quot;ec2:DescribeSubnets&quot;,
                &quot;ec2:DescribeVpcs&quot;,
                &quot;eks:CreateCluster&quot;,
                &quot;eks:DescribeCluster&quot;,
                &quot;iam:AddRoleToInstanceProfile&quot;,
                &quot;iam:AttachRolePolicy&quot;,
                &quot;iam:CreateRole&quot;,
                &quot;iam:CreateInstanceProfile&quot;,
                &quot;iam:CreateServiceLinkedRole&quot;,
                &quot;iam:GetRole&quot;,
                &quot;iam:ListRoles&quot;,
                &quot;iam:PassRole&quot;,
                &quot;ssm:GetParameters&quot;
            ],
            &quot;Resource&quot;: &quot;*&quot;
        }
    ]
}
</code></pre>
<p>After this I copied the ARN of the newly created role and Used it in My Project's Kubernetes section. ()</p>
<p>Had got this as the response <code>Error: Request failed with status code 422</code></p>
<p><a href="https://i.stack.imgur.com/3RVcz.png" rel="nofollow noreferrer">Response after clicking on &quot;Authenticate with AWS&quot;</a></p>

PRANAV
<p>Attached this policy to the user whose access key and secret key was used while enabling EKS in GitLab.</p>
<pre><code>{
    &quot;Version&quot;: &quot;2012-10-17&quot;,
    &quot;Statement&quot;: {
        &quot;Effect&quot;: &quot;Allow&quot;,
        &quot;Action&quot;: &quot;sts:AssumeRole&quot;,
        &quot;Resource&quot;: &quot;arn:aws:iam::&lt;&lt;account-id&gt;&gt;:role/gitlab-eks-4&quot;
    }
}
</code></pre>
<p>This gives the user the privilege to assume the gitlab-eks role (which has been created and whose ARN has been given while EKS integration)</p>
