In this example, we will demonstrate how to deploy an AWS EKS cluster using Pulumi on LocalStack. With the help of the Pulumi Python SDK, we will declaratively provision AWS resources & infrastructure locally on LocalStack and on the real AWS cloud.
- A valid LocalStack for AWS license. Your license provides a
LOCALSTACK_AUTH_TOKEN. - Docker
localstackCLIawslocalCLI- Pulumi
pulumilocalCLIkubectlmakeandjq
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
localstack auth set-token $LOCALSTACK_AUTH_TOKEN
localstack start -d
localstack wait -t 30pulumilocal stack init python-eks-testing
pulumilocal config set aws:region us-east-1To preview and deploy the stack, run:
pulumilocal upYou can view the deployed EKS cluster by running:
awslocal eks list-clustersYou can next update your KubeConfig, authenticate to your Kubernetes Cluster and verify you have API access and nodes running by running the following commands:
awslocal eks update-kubeconfig --name <CLUSTER_NAME>
kubectl get nodesReplace <CLUSTER_NAME> with the name of your EKS cluster. For further details, see the LocalStack EKS documentation.
This code is available under the Apache 2.0 license.