---
title: "AWS Golang EKS Cluster"
description: "Deploys a container into an EKS cluster with a Managed Node Group."
url: "https://www.pulumi.com/dev/examples/aws-go-eks/"
image: "https://www.pulumi.com/assets/og/dev/examples/aws-go-eks.png"
---

# AWS Golang EKS Cluster

Deploys a container into an EKS cluster with a Managed Node Group.

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

## Get started with this example

This example lives in the [pulumi/examples](https://github.com/pulumi/examples/tree/master/aws-go-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-go-eks
cd pulumi-examples/aws-go-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 Go](https://golang.org/doc/install)
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)
5. [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
    ```

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

    ```bash
    pulumi up
    ```

4. 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
    ```

5. Ensure that the application is running as expected:

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

6. Afterwards, destroy your stack and remove it:

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