---
title: "Kubernetes Cluster on AWS"
description: "Deploy a managed Kubernetes cluster on AWS with Pulumi and Amazon EKS in TypeScript, Python, Go, C#, YAML, or HCL."
url: "https://www.pulumi.com/dev/templates/kubernetes/aws/"
image: "https://www.pulumi.com/assets/og/dev/templates/kubernetes/aws.png"
---

# Kubernetes Cluster on AWS

Deploy a managed Kubernetes cluster on AWS with Pulumi and Amazon EKS in TypeScript, Python, Go, C#, YAML, or HCL.

The AWS Kubernetes Cluster template scaffolds a Pulumi project that provisions a managed [Amazon EKS cluster](https://www.pulumi.com/registry/packages/eks/api-docs/cluster/) inside a new VPC with public and private subnets. Worker nodes run in the private subnets for improved security; load balancers created by cluster workloads are automatically placed in the public subnets.

![An architecture diagram of the AWS Kubernetes Cluster template](./architecture.png)

## Using this template

To use this template to deploy your own managed Kubernetes cluster, make sure you've [installed Pulumi](https://www.pulumi.com/docs/install/) and [configured your AWS credentials](https://www.pulumi.com/registry/packages/aws/installation-configuration#credentials), then create a new [project](https://www.pulumi.com/docs/iac/concepts/projects/) using the template in the language of your choice:

**TypeScript**

```bash
mkdir my-k8s-cluster && cd my-k8s-cluster
pulumi new kubernetes-aws-typescript
```

**Python**

```bash
mkdir my-k8s-cluster && cd my-k8s-cluster
pulumi new kubernetes-aws-python
```

**Go**

```bash
mkdir my-k8s-cluster && cd my-k8s-cluster
pulumi new kubernetes-aws-go
```

**C#**

```bash
mkdir my-k8s-cluster && cd my-k8s-cluster
pulumi new kubernetes-aws-csharp
```

**YAML**

```bash
mkdir my-k8s-cluster && cd my-k8s-cluster
pulumi new kubernetes-aws-yaml
```

**HCL**

```bash
mkdir my-k8s-cluster && cd my-k8s-cluster
pulumi new kubernetes-aws-hcl
```

Follow the prompts to complete the new-project wizard. When it's done, you'll have a complete Pulumi project that's ready to deploy and configured with the most common settings. Feel free to inspect the code in `index.ts` for a closer look.

## Deploying the project

The template requires no additional configuration. Once the new project is created, you can deploy it immediately with [`pulumi up`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_up):

```bash
$ pulumi up
```

When the deployment completes, Pulumi exports the following [stack output](https://www.pulumi.com/docs/iac/concepts/stacks/#outputs) values:

**TypeScript / Python / Go / C# / YAML**

**`kubeconfig`**

The cluster's kubeconfig file, which you can use with `kubectl` to access and communicate with your cluster.

**`vpcId`**

The ID of the VPC that your cluster is running in.

**HCL**

**`vpc_id`**

The ID of the VPC that your cluster is running in.

**`kubeconfig`**

The cluster's kubeconfig file, which you can use with `kubectl` to access and communicate with your cluster.

Output values like these are useful in many ways, most commonly as inputs for other stacks or related cloud resources.

## Customizing the project

Projects created with the Kubernetes template expose the following [configuration](https://www.pulumi.com/docs/iac/concepts/config/) settings:

**TypeScript / Python / Go / C# / YAML**

**`minClusterSize`**

The minimum number of nodes to allow in the cluster. Defaults to `3`.

**`maxClusterSize`**

The maximum number of nodes to allow in the cluster. Defaults to `6`.

**`desiredClusterSize`**

The desired number of nodes in the cluster. Defaults to `3`.

**`eksNodeInstanceType`**

The EC2 instance type to use for the nodes. Defaults to `t3.medium`.

**`vpcNetworkCidr`**

The network CIDR to use for the VPC. Defaults to `10.0.0.0/16`.

**HCL**

**`min_cluster_size`**

The minimum number of nodes to allow in the cluster. Defaults to `3`.

**`max_cluster_size`**

The maximum number of nodes to allow in the cluster. Defaults to `6`.

**`desired_cluster_size`**

The desired number of nodes in the cluster. Defaults to `3`.

**`node_instance_type`**

The EC2 instance type to use for the nodes. Defaults to `t3.medium`.

**`vpc_network_cidr`**

The network CIDR to use for the VPC. Defaults to `10.0.0.0/16`.

All of these settings are optional and may be adjusted either by editing the stack configuration file directly (by default, `Pulumi.dev.yaml`) or by changing their values with [`pulumi config set`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_config_set).

## Cleaning up

You can cleanly destroy the stack and all of its infrastructure with [`pulumi destroy`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_destroy):

```bash
$ pulumi destroy
```

## Learn more

- Browse other architecture templates in the [Templates gallery](https://www.pulumi.com/templates).
- Explore the [Amazon EKS](https://www.pulumi.com/registry/packages/eks/) and [AWSx](https://www.pulumi.com/registry/packages/awsx) provider API docs in the Pulumi Registry.
- Walk through Pulumi from the ground up in [Pulumi Tutorials](https://www.pulumi.com/dev/browse/?type=tutorial).
- Read the latest [Kubernetes posts on the Pulumi blog](https://www.pulumi.com/blog/tag/kubernetes).
