Hi. I tried to create a simple AWS EKS cluster for...
# getting-started
w
Hi. I tried to create a simple AWS EKS cluster for testing purpose.
Copy code
import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";

// Create a VPC for our cluster.
const vpc = new awsx.ec2.Vpc("pulumi-test-vpc", {
  cidrBlock: "10.0.0.0/16",
  numberOfAvailabilityZones: 3,
});

// Create an EKS cluster.
const cluster = new eks.Cluster("pulumi-test-cluster", {
  instanceType: "t2.small",
  desiredCapacity: 2,
  minSize: 1,
  maxSize: 2,
});

// Export the cluster's kubeconfig.
export const kubeconfig = cluster.kubeconfig;
For some reason, VPC was created with empty name " ", and my EKS cluster was attached to the Default VPC. It took 14m+ to finish deploying. When I destroyed the deployment, weird enough it deleted the whole thing correctly, even the empty name VPC. Any ideas?
e
You haven't told the cluster to use that VPC, I think you just need to add
vpcId: vpc.id,
to the cluster settings.
w
I see. That explains the Default VPC. Thank you! What about the empty VPC name? Any thoughts?
e
So I think that's because vpcs don't "need" a name so we don't automatically give them one. I think a tag of "name" or maybe "Name" should work
tags: { name: "some name" }
🙌 1
Arguably the awsx library should do this for you so feel free to raise a issue about that at https://github.com/pulumi/pulumi-awsx/issues
🙌 1