> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tembo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS reference

> EKS and VPC requirements, the tembo-agent-host Terraform module, and the resources it creates on AWS.

Details behind the AWS steps in [Prerequisites](https://docs.tembo.io/features/self-hosted/kubernetes/prerequisites.md) and [Install](https://docs.tembo.io/features/self-hosted/kubernetes/install.md). On AWS, Tembo runs on EKS and launches agent hosts as EC2 instances in your VPC.

## Cluster

* **EKS Pod Identity.** The module binds its roles to the chart's service accounts through the EKS Pod Identity agent. To use IAM roles for service accounts instead, set the module's `identity_type = "irsa"`; the cluster then needs an IAM OIDC provider.
* **ACM certificates** for your hostname and its previews wildcard, in the cluster's region. See [Ingress and certificates](https://docs.tembo.io/features/self-hosted/kubernetes/networking.md#ingress-and-certificates).

### IngressClass

The chart's Ingresses use the IngressClass you name in `ingress.className`; empty uses the cluster's default IngressClass. Any name works. The examples use `alb`, which the AWS Load Balancer Controller's Helm chart creates.

On EKS Auto Mode, create an IngressClass yourself, for example:

```yaml theme={null}
apiVersion: eks.amazonaws.com/v1
kind: IngressClassParams
metadata:
  name: alb
spec:
  scheme: internet-facing
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
  name: alb
spec:
  controller: eks.amazonaws.com/alb
  parameters:
    apiGroup: eks.amazonaws.com
    kind: IngressClassParams
    name: alb
```

## VPC and subnets

Agent hosts launch into subnets you choose, in the cluster's VPC:

* **Private subnets with a NAT gateway.** Hosts need outbound access to your Tembo URL, Tembo's API, object storage, model providers and code hosts such as GitHub.

* **Several Availability Zones that offer your instance types.** `c8id.8xlarge` isn't offered in every zone; when one zone runs out of capacity, the controller tries the next. To list the zones that offer it:

  ```bash theme={null}
  aws ec2 describe-instance-type-offerings --location-type availability-zone \
    --filters Name=instance-type,Values=c8id.8xlarge --query 'InstanceTypeOfferings[].Location'
  ```

* **The cluster's API reachable from them.** Hosts read their configuration through the cluster endpoint. Turn on the endpoint's private access; the module opens port 443 on the cluster security group for them. With public access only, allow your NAT gateways' addresses in the endpoint's public access CIDRs.

The module selects subnets by ID (`host_subnet_ids`) or by an existing tag (`host_subnet_tags`), such as `karpenter.sh/discovery`. It doesn't change or tag them.

## Quotas

Each `c8id.8xlarge` host uses 32 vCPUs of the **Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances** quota in the region, which also counts your cluster's on-demand nodes. The default pool runs up to three hosts. Check the quota in **Service Quotas > Amazon EC2** and request more if needed.

## Permissions to apply

The identity that runs Terraform needs to read the EKS cluster and create:

* IAM roles, inline policies and an instance profile.
* A security group and its rules, including a rule on the cluster security group.
* An S3 bucket and its settings.
* EKS Pod Identity associations.

## The Terraform module

The [`tembo-agent-host` module](https://github.com/tembo/terraform-aws-tembo-agent-host) needs AWS provider 5.79 or later. It creates:

* **The host controller's role**, bound to the chart's service account. It can launch instances only into your subnets, with the module's security group and instance profile, and terminate only the instances it tagged.
* **The agent hosts' role and instance profile**, with access to the install's bucket and, by default, Session Manager.
* **The hosts' security group:** the host manager's port (8743) from the cluster, all egress, and the hosts' access to the Kubernetes API.
* **An S3 bucket** for project images, session snapshots and file uploads, and the control plane's role to use it. To use a bucket you have, set `object_storage_bucket_name`.

The roles trust only the chart's service accounts in `kubernetes_namespace`, for `release_name`. See the [module's inputs](https://github.com/tembo/terraform-aws-tembo-agent-host#inputs) for the other options, such as `instance_types`.

Its `helm_values` output configures the chart with:

* The host controller and its role.
* A host class named `default`, with your subnets, the security group, the instance profile, `c8id.8xlarge` and Tembo's `stable` agent host image.
* A pool named `default`, of one to three hosts.
* Object storage, with the bucket and the control plane's role.
* On EKS Auto Mode, the class for the internal load balancers agent hosts reach Postgres and Redis through.

### Managed Postgres or Redis

With your own Postgres or Redis instead of the chart's, let agent hosts reach their security groups:

```hcl theme={null}
module "tembo" {
  # ...
  host_access_rules = [
    { security_group_id = "<postgres-sg>", port = 5432, description = "Postgres from Tembo agent hosts" },
    { security_group_id = "<redis-sg>", port = 6379, description = "Redis from Tembo agent hosts" },
  ]
}
```

Then configure the chart for them (see [Postgres and Redis](https://docs.tembo.io/features/self-hosted/kubernetes/configuration.md#postgres-and-redis)).

***

## Need Help?

If you run into any issues, contact [support@tembo.io](mailto:support@tembo.io).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.