# AWS Nitro (/docs/build/compute/aws-nitro)

<PreviewBadge />

AWS Nitro compute runs managed-agent sandboxes in an Amazon EKS cluster you control. Dome creates one scoped Kubernetes job for each run attempt and removes it when the run ends. This guide prepares the cluster, configures the minimum access, and validates the connection.

## Before you begin [#before-you-begin]

An AWS Nitro connection requires an organization with [public preview](/manage/public-preview) enabled where AWS Nitro compute is available, a Dome workspace administrator, and AWS access that can configure EKS, IAM, and Kubernetes RBAC. Use an EKS cluster running Kubernetes 1.36 or later on supported amd64 Nitro-capable capacity. EKS Auto Mode is a suitable option.

The cluster needs an API endpoint that Dome can reach. If you restrict public EKS API access by CIDR, include the workspace-specific Dome egress CIDRs shown by `dome compute providers`.

> **Note**: Dome does not store AWS credentials for AWS Nitro. It assumes a narrowly scoped IAM role in your AWS account with a workspace-specific external ID.

## Plan the network and cluster [#plan-the-network-and-cluster]

The sandbox needs egress to the Dome gateway and its required image sources. A common EKS layout uses private worker subnets, public subnets for NAT gateways, and a NAT gateway for each availability zone in production. NAT charges can continue while the cluster has no active nodes.

| Requirement                     | Why it matters                                                                                   |
| ------------------------------- | ------------------------------------------------------------------------------------------------ |
| EKS 1.36 or later               | Nitro sandbox runtime support requires the supported Kubernetes version.                         |
| Network policy enforcement      | Dome's workload policy constrains sandbox egress to the gateway path.                            |
| Reachable EKS API               | Dome validates the cluster and creates only its scoped run resources through the Kubernetes API. |
| `isolated-sandbox` RuntimeClass | Each run job uses this runtime for sandbox isolation.                                            |
| Dedicated namespace             | Dome's role is restricted to one namespace, which should contain only Dome workloads.            |
| Outbound network path           | Pods must reach the Dome gateway and image sources.                                              |

Enable the Amazon VPC CNI network policy controller before you connect the cluster:

```bash
kubectl -n kube-system patch configmap amazon-vpc-cni --type merge \
  -p '{"data":{"enable-network-policy-controller":"true"}}' \
  || kubectl -n kube-system create configmap amazon-vpc-cni \
  --from-literal=enable-network-policy-controller=true
```

An idle EKS Auto Mode cluster may have no nodes. The first sandbox run can take longer while the cluster starts capacity.

## Get the workspace-specific setup values [#get-the-workspace-specific-setup-values]

Do not reuse values from another workspace or write the trust, RBAC, or admission manifests by hand. The provider catalog returns the exact external ID, Dome principal, EKS role, admission rule, and egress CIDRs for the active workspace.

```bash
dome compute providers
```

Use the AWS Nitro entry from that command as the source of truth for the following steps. The external ID is derived for one workspace and must be required by the IAM role.

## Create the scoped AWS and Kubernetes access [#create-the-scoped-aws-and-kubernetes-access]

Apply the values returned by the provider catalog in this order. This keeps Dome scoped to one EKS cluster and one namespace.

| Step | Configure                 | Scope and outcome                                                                                                                                        |
| ---- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1    | Create a namespace        | Create a non-`kube-` namespace used only for Dome sandbox jobs.                                                                                          |
| 2    | Create the IAM role       | Use the supplied trust policy with the workspace external ID. Its permission policy permits only `eks:DescribeCluster` for the selected cluster.         |
| 3    | Add an EKS access entry   | Add the role as a standard EKS access entry in the `dome-runner` Kubernetes group. Do not attach an EKS access policy.                                   |
| 4    | Apply the Kubernetes role | Apply the catalog-provided namespace role. It permits the jobs, pods, network policies, exec, and events needed for a run, without secret or log access. |
| 5    | Apply the admission rule  | Apply the `dome-run-scope` rule with its required name. It locks each session to its own run resources and requires the sandbox runtime.                 |

For the EKS access entry, use the selected cluster, region, and role ARN:

```bash
aws eks create-access-entry \
  --region {{AWS_REGION}} \
  --cluster-name {{EKS_CLUSTER_NAME}} \
  --principal-arn {{ROLE_ARN}} \
  --type STANDARD \
  --kubernetes-groups dome-runner
```

The IAM role must belong to your AWS account. Dome rejects a role in Dome's own AWS account.

## Create and validate the connection [#create-and-validate-the-connection]

Create the compute connection after the cluster prerequisites are in place. The fields below use the provider's required setting names.

```bash
dome compute create \
  --name aws-production \
  --provider aws-nitro \
  --setting region=us-east-1 \
  --setting cluster_name={{EKS_CLUSTER_NAME}} \
  --setting namespace=dome-sandboxes \
  --setting role_arn={{ROLE_ARN}}
```

Creating an AWS Nitro connection requests an asynchronous setup check. Wait for the result before assigning production managed agents:

```bash
dome compute check aws-production --wait
```

The check verifies the IAM trust and external ID, cluster reachability, namespace RBAC, the admission rule, and the `isolated-sandbox` RuntimeClass. A failed result identifies the first failed step. Update the infrastructure or connection settings, then run the check again.

## Assign an agent and test a run [#assign-an-agent-and-test-a-run]

After the check passes, assign the connection to a managed agent. New runs use the external sandbox. Existing runs continue on their original connection.

```bash
dome managed-agents update nightly-triage --compute aws-production
dome managed-agents run nightly-triage --input "Run a sandbox verification."
```

Inspect the run and the compute audit events to confirm the provider reference and cleanup result:

```bash
dome managed-agents runs get {{RUN_ID}}
```

## Troubleshoot setup and runs [#troubleshoot-setup-and-runs]

The setup check is the first diagnostic step. The outcome separates customer configuration failures from Dome-side failures and AWS throttling.

| Symptom                                                   | Likely cause                                                                              | Next action                                                  |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| `role_requires_external_id` fails                         | The IAM trust policy omits the workspace-specific external ID or accepts IDs too broadly. | Replace it with the provider-catalog trust policy.           |
| `cluster_reachable` fails                                 | The EKS endpoint is private or its public CIDR allowlist excludes Dome.                   | Make the endpoint reachable or add the catalog egress CIDRs. |
| `namespace`, `kubernetes_role`, or `admission_rule` fails | The namespace resources are missing, drifted, or use a different admission rule name.     | Reapply the workspace-provided manifests.                    |
| `sandbox_runtime` fails                                   | The cluster is not prepared for the required Nitro sandbox runtime.                       | Verify the EKS version and runtime support.                  |
| A first run is slow                                       | The EKS cluster is starting Auto Mode capacity.                                           | Wait for nodes to start and inspect the run status.          |
| A run is refused for its external ID                      | The role can be assumed without this workspace's external ID.                             | Correct the trust policy and re-run the setup check.         |

Use [compute](/build/compute#runtime-behavior-and-audit-trail) to interpret the full run and cleanup audit trail. For automation, use the [compute CLI](/cli/build/compute), [compute MCP tools](/reference/mcp/compute), or [compute API](/api/tag/compute).