---
title: "AWS C# EKS Cluster"
description: "An ASP.NET application running a simple container in a EKS Cluster"
url: "https://www.pulumi.com/dev/examples/aws-cs-eks/"
image: "https://www.pulumi.com/assets/og/dev/examples/aws-cs-eks.png"
---

# AWS C# EKS Cluster

An ASP.NET application running a simple container in a EKS Cluster

- Source on GitHub: https://github.com/pulumi/examples/tree/master/aws-cs-eks

## Get started with this example

This example lives in the [pulumi/examples](https://github.com/pulumi/examples/tree/master/aws-cs-eks) repo. Pull down just this directory to follow along:

```bash
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set aws-cs-eks
cd pulumi-examples/aws-cs-eks
```

This example creates an AWS EKS Cluster and deploys a sample container application to it

## Deploying the App

 To deploy your infrastructure, follow the below steps.

### Prerequisites

1. [Install Pulumi](https://www.pulumi.com/docs/get-started/install/)
2. [Install DotNet SDK](https://docs.microsoft.com/en-us/dotnet/core/install/sdk?pivots=os-windows)
3. [Configure AWS Credentials](https://www.pulumi.com/docs/intro/cloud-providers/aws/setup/)
4. [Install `aws-iam-authenticator`](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html)
4. [Install `kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/)

### Steps

After cloning this repo, run these commands from the working directory:

1. Create a new stack, which is an isolated deployment target for this example:

    ```bash
    $ pulumi stack init dev
    ```

2. Set your desired AWS region:

    ```bash
    $ pulumi config set aws:region us-east-1 # any valid AWS region will work
    ```

4. Execute the Pulumi program to create our EKS Cluster:

	```bash
	pulumi up
	```

5. After 10-15 minutes, your cluster will be ready, and the kubeconfig JSON you'll use to connect to the cluster will
   be available as an output. You can save this kubeconfig to a file like so:

    ```bash
    $ pulumi stack output kubeconfig --show-secrets >kubeconfig.json
    ```

    Once you have this file in hand, you can interact with your new cluster as usual via `kubectl`:

    ```bash
    $ KUBECONFIG=./kubeconfig.json kubectl get nodes
    ```

6. Ensure that the application is running as expected:

    ```bash
   $ curl $(pulumi stack output Url)
   ```


7. Afterwards, destroy your stack and remove it:

	```bash
	pulumi destroy --yes
	pulumi stack rm --yes
	```
