https://pulumi.com logo
#typescript
Title
# typescript
c

calm-parrot-72437

01/30/2020, 5:51 PM
pulumi and ts noob here. I'm attempting to create a k8s cluster with eks and I'd like to set the public key used for the VMs. This is what I've got: const nodePublicKeyPair = new aws.ec2.KeyPair("eks", { publicKey: "ssh-rsa ..." }) const cluster = new eks.Cluster(env, { ... nodePublicKey: nodePublicKeyPair, ... }) That errors out with this error: Types of property 'nodePublicKey' are incompatible. Type 'KeyPair' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'. Type 'KeyPair' is missing the following properties from type 'OutputInstance<string>': apply, get Any ideas?
n

nice-guitar-97142

01/30/2020, 5:57 PM
you are trying to pass an object of type
aws.ec2.KeyPair
to the
eks.Cluster.nodePublicKey
property, which expects a string. Option A:
Copy code
const cluster = new eks.Cluster(env, {
  ...
  nodePublicKey: "ssh-rsa...",
  ...
})
Option B:
Copy code
const cluster = new eks.Cluster(env, {
  ...
  nodePublicKey: nodePublicKeyPair.nodePublicKey,
  ...
})
3 Views