https://pulumi.com logo
#general
Title
# general
a

acceptable-lawyer-72941

04/23/2023, 2:17 PM
Hi everyone. I’m having difficulties generating a tls.PrivateKey. package.json
Copy code
{
  "name": "test_k8s_cluster",
  "main": "index.ts",
  "devDependencies": {
    "@types/figlet": "^1.5.5",
    "@types/node": "^16"
  },
  "dependencies": {
    "@pulumi/aws": "^5.37.0",
    "@pulumi/awsx": "^1.0.2",
    "@pulumi/cloudflare": "^5.0.0",
    "@pulumi/eks": "^1.0.1",
    "@pulumi/kubernetes": "^3.25.0",
    "@pulumi/pulumi": "^3.64.0",
    "@pulumi/tls": "^4.10.0",
    "figlet": "^1.6.0"
  }
}
index.ts (imports):
Copy code
import * as awsx from "@pulumi/awsx";
import * as aws from "@pulumi/aws";
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";
import * as cloudflare from "@pulumi/cloudflare";
import * as pulumi from "@pulumi/pulumi";
import * as tls from "@pulumi/tls";
index.ts (offending code):
Copy code
const CLUSTER_KEY_GENERATION_ALGORITHM = "ED25519";

    const awsRegion: aws.Region = awsConfig.require("region");
    const awsProvider = new aws.Provider("aws-provider", {
        region: awsRegion,
    });

    // Create a PrivateKey for the Kubernetes cluster
    const clusterPrivateKey = new tls.PrivateKey("cluster-private-key", {
        algorithm: CLUSTER_KEY_GENERATION_ALGORITHM,
    }, { provider: awsProvider });
output:
Copy code
❯ pulumi up
Previewing update (dev)

View in Browser (Ctrl+O): <https://app.pulumi.com/xxx/xxx/dev/previews/a4>....

     Type                     Name                 Plan       Info
     pulumi:pulumi:Stack      xxxxx-infra-aws-dev             1 error
 ~   ├─ pulumi:providers:aws  aws-provider         update     [diff: ~version]
 +   ├─ aws:ec2:Eip           bastion-eip          create     
 +   ├─ aws:ec2:KeyPair       bastion-key-pair     create     
     └─ tls:index:PrivateKey  cluster-private-key             1 error


Diagnostics:
  tls:index:PrivateKey (cluster-private-key):
    error: unrecognized resource type (Check): tls:index/privateKey:PrivateKey
There seems to be an extra “index” but not sure why. Is this a bug or am I using @pulumi/tls incorrectly? Thank you for your help.
b

billowy-army-68599

04/23/2023, 2:31 PM
could you open an issue, there have been some changes to the tls provider which may be ther cause of this
a

acceptable-lawyer-72941

04/23/2023, 2:49 PM
Thanks @billowy-army-68599
b

billowy-army-68599

04/23/2023, 2:51 PM
also, try downgrading the tls version
4.6.1
to see if that helps
a

acceptable-lawyer-72941

04/23/2023, 2:52 PM
I think I tried that, but will try again just to be sure. I’m using the crypto library to do keygen for now. Will get an issue in sometime later today. Thanks for your help.
s

salmon-musician-36333

04/23/2023, 11:15 PM
I'm getting something similar with
eks.Cluster
, is it incorrect?
Copy code
├─ eks:index:Cluster
b

billowy-army-68599

04/23/2023, 11:41 PM
no, that’s expected