# Amazon Web Services (EKS)

{% hint style="info" %}
Infra App connects automatically to most clusters. If running `kubectl` works without any modifications or custom scripts, then Infra App will also work out of the box.
{% endhint %}

### Prerequisites

* Create an [EKS cluster](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html)
* Download and setup the [AWS CLI](https://www.google.com/search?q=aws+cli+v2\&oq=aws+cli+v2\&aqs=chrome..69i57j69i59j69i60l4.765j0j7\&sourceid=chrome\&ie=UTF-8) (preferably version 2)
* [Configure the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) with the credentials AWS user that has access to the cluster

### Generating a config file

[Create a config file entry](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html) using the `aws` CLI. For example:

```bash
aws eks --region <region-code> update-kubeconfig --name <cluster_name>
```

You're done! Infra App should automatically switch to your cluster. You can switch to it at any time via the cluster dropdown:

![](/files/-MKCh7FQ1vexF0q_U-Qu)

### Installing Metrics Server

AWS EKS clusters don't include metrics server by default, so real-time CPU & Memory usage metrics won't show out of the box with Infra App.

Follow the [official guide](https://docs.aws.amazon.com/eks/latest/userguide/metrics-server.html) on the AWS docs site to install metrics server on your cluster.

### Usage with custom profiles

In order to use a custom AWS profile to connect to your cluster, you'll need to edit your Kubernetes config file. This file is usually found in:

* `~/.kube/config` on macOS and Linux
* `C:\Users\<your user>\.kube\config` on Windows

Open this file and edit the relevant user object in the `users:` section. add an `AWS_PROFILE` environment variable .

```yaml
users:
- name: arn:aws:eks:us-east-1:00919287195771:cluster/example-cluster
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - --region
      - us-east-1
      - eks
      - get-token
      - --cluster-name
      - example-cluster
      command: aws
      # Add these lines to your KubeConfig
      env:
      - name: AWS_PROFILE
        value: <your profile>
```

### Usage with `aws-iam-authenticator`

Older EKS clusters may use `aws-iam-authenticator` to generate tokens. If your cluster uses this make sure it's [installed](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html) before using Infra App.

### Usage with `aws-okta`

Usage with `aws-okta` is not supported yet, but we are working on it.

### Usage with `aws-vault`

Usage with `aws-vault` is not supported yet, but we are working on it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infra.app/connect-your-cluster/amazon-web-services-eks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
