am I missing something, or is there no way to spec...
# general
d
am I missing something, or is there no way to specify a name for an EKS cluster with Pulumi?
b
How does your resource look like?
d
Copy code
// EKS Cluster
const cluster = new eks.Cluster("test-cluster", {
  name: "test-cluster",
  version: "1.13",
  vpcId: vpcId,
  subnetIds: vpcPrivateSubnetIds,
  nodeSubnetIds: vpcPrivateSubnetIds,
  nodeAssociatePublicIpAddress: false,
  desiredCapacity: 3,
  maxSize: 3,
  minSize: 3,
  instanceType: "t3a.medium",
  nodePublicKey: sshPublicKey,
  instanceRole: eksWorkerRole,
  deployDashboard: false,
  userMappings: clusterAdmins.map(getClusterAdminMappingByUsername)
});
with that,
pulumi preview
outputs:
Copy code
+ aws:eks/cluster:Cluster: (create)
            [urn=urn:pulumi:test::infrastructure::eks:index:Cluster$aws:eks/cluster:Cluster::test-cluster-eksCluster]
            [provider=urn:pulumi:test::infrastructure::pulumi:providers:aws::default_1_0_0_beta_1::08e235b2-6481-4732-82e5-e9fb91bc1d51]
            name      : "test-cluster-eksCluster-e204193"
b
And it’s not assigning the “test-cluster” name?
d
it’s appending
eksCluster-randomID
to the name
b
Is eks.Ckuster your abstraction? I would have expected an aws.eks.Cluster in there
d
b
Ah ok so it’s Pulumi/eks
I thought it was Pulumi-aws/eks
Let me look at the eks codebase real quick
d
so
eks.Cluster
and
aws.eks.Cluster
are different things?
b
yes
eks is abstraction layer
and I can see, that inside it does this
Copy code
// Create the EKS cluster
    const eksCluster = new aws.eks.Cluster(`${name}-eksCluster`, {
        roleArn: eksRole.apply(r => r.arn),
        vpcConfig: {
            securityGroupIds: [eksClusterSecurityGroup.id],
            subnetIds: subnetIds,
            endpointPrivateAccess: args.endpointPrivateAccess,
            endpointPublicAccess: args.endpointPublicAccess,
        },
        version: args.version,
        enabledClusterLogTypes: args.enabledClusterLogTypes,
    }, {
        parent: parent,
        provider: args.creationRoleProvider ? args.creationRoleProvider.provider : undefined,
    });
notice the
-eksCluster
that's what you are seeing
I guess if you need more fine grained control over the naming, then you might want to use the AWS provider directly?
then you can pass a name to the aws.eks.Cluster
sorry for the confusion here 😞
a
I have created an issue to suggesting that the name passed to
new eks.Cluster()
is used to name the AWS resource: https://github.com/pulumi/pulumi-eks/issues/240
a
+1 on this would really like to be able to modify name as part of eks.Cluster