sparse-intern-71089
10/27/2023, 9:36 AMdry-keyboard-94795
10/27/2023, 9:44 AMprivateKeyOpenssh
for ssh usage, that should work provided the public key is loaded onto the server
https://www.pulumi.com/registry/packages/tls/api-docs/privatekey/#privatekeyopenssh_nodejsnarrow-monitor-83965
10/27/2023, 9:57 AMconst tlsKey = new tls.PrivateKey("tls-key", {
algorithm: "ED25519",
});
const publicKey = tlsKey.publicKeyOpenssh
const k3sMaster1 = new hcloud.Server("k3s-master-1", {
name: "k3s-master-1",
image: "rocky-9",
serverType,
deleteProtection,
sshKeys: [hKey.name, localKey],
labels: {
"k3s-master": "true"
},
networks: [{
networkId: k3sNetwork.id,
ip: "10.8.8.10"
}],
userData: `
#cloud-config
users:
- name: ansible
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_authorized_keys:
- "${publicKey}"
sudo: 'ALL=(ALL) NOPASSWD:ALL'
runcmd:
- sudo yum update -y
- sudo reboot
`
}, {
dependsOn: [k3sNetwork, hKey]
})
dry-keyboard-94795
10/27/2023, 10:00 AMOutput<string>
, so you'll need to use something like pulumi.interpolate
to access the contents.
See here: https://www.pulumi.com/docs/concepts/inputs-outputs/#outputs-and-stringsnarrow-monitor-83965
10/27/2023, 10:01 AM