Viewing docs for Linode v6.8.0
published on Wednesday, Oct 21, 2026 by Pulumi
published on Wednesday, Oct 21, 2026 by Pulumi
Viewing docs for Linode v6.8.0
published on Wednesday, Oct 21, 2026 by Pulumi
published on Wednesday, Oct 21, 2026 by Pulumi
linode.SshKey provides access to a specifically identified SSH Key in the Profile of the User identified by the access token.
For more information, see the Linode APIv4 docs.
Example Usage
The following example shows how one might use this data source to access information about an SSH Key configured on the Linode user profile.
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const foo = linode.getSshKey({
label: "foo",
});
const bar = linode.getSshKey({
id: "1234567",
});
import pulumi
import pulumi_linode as linode
foo = linode.get_ssh_key(label="foo")
bar = linode.get_ssh_key(id="1234567")
package main
import (
"github.com/pulumi/pulumi-linode/sdk/v6/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := linode.GetSshKey(ctx, &linode.LookupSshKeyArgs{
Label: pulumi.StringRef("foo"),
}, nil)
if err != nil {
return err
}
_, err = linode.GetSshKey(ctx, &linode.LookupSshKeyArgs{
Id: pulumi.StringRef("1234567"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() =>
{
var foo = Linode.GetSshKey.Invoke(new()
{
Label = "foo",
});
var bar = Linode.GetSshKey.Invoke(new()
{
Id = "1234567",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetSshKeyArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var foo = LinodeFunctions.getSshKey(GetSshKeyArgs.builder()
.label("foo")
.build());
final var bar = LinodeFunctions.getSshKey(GetSshKeyArgs.builder()
.id("1234567")
.build());
}
}
variables:
foo:
fn::invoke:
function: linode:getSshKey
arguments:
label: foo
bar:
fn::invoke:
function: linode:getSshKey
arguments:
id: '1234567'
terraform {
required_providers {
linode = {
source = "pulumi/linode"
}
}
}
data "linode_ssh_key" "foo" {
label = "foo"
}
data "linode_ssh_key" "bar" {
id = "1234567"
}
Using getSshKey
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSshKey(args: GetSshKeyArgs, opts?: InvokeOptions): Promise<GetSshKeyResult>
function getSshKeyOutput(args: GetSshKeyOutputArgs, opts?: InvokeOutputOptions): Output<GetSshKeyResult>def get_ssh_key(id: Optional[str] = None,
label: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSshKeyResult
def get_ssh_key_output(id: pulumi.Input[Optional[str]] = None,
label: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetSshKeyResult]func LookupSshKey(ctx *Context, args *LookupSshKeyArgs, opts ...InvokeOption) (*LookupSshKeyResult, error)
func LookupSshKeyOutput(ctx *Context, args *LookupSshKeyOutputArgs, opts ...InvokeOption) LookupSshKeyResultOutput> Note: This function is named LookupSshKey in the Go SDK.
public static class GetSshKey
{
public static Task<GetSshKeyResult> InvokeAsync(GetSshKeyArgs args, InvokeOptions? opts = null)
public static Output<GetSshKeyResult> Invoke(GetSshKeyInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetSshKeyResult> Invoke(GetSshKeyInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetSshKeyResult> getSshKey(GetSshKeyArgs args, InvokeOptions options)
public static Output<GetSshKeyResult> getSshKey(GetSshKeyArgs args, InvokeOptions options)
public static Output<GetSshKeyResult> getSshKey(GetSshKeyArgs args, InvokeOutputOptions options)
fn::invoke:
function: linode:index/getSshKey:getSshKey
arguments:
# arguments dictionarydata "linode_get_ssh_key" "name" {
# arguments
}The following arguments are supported:
getSshKey Result
The following output properties are available:
- Created string
- The date this key was added.
- Id string
- The ID of the SSH Key. Computed when
labelis used as the selector. - Label string
- The label of the SSH Key. Computed when
idis used as the selector. - Ssh
Key string - The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
- Created string
- The date this key was added.
- Id string
- The ID of the SSH Key. Computed when
labelis used as the selector. - Label string
- The label of the SSH Key. Computed when
idis used as the selector. - Ssh
Key string - The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
- created string
- The date this key was added.
- id string
- The ID of the SSH Key. Computed when
labelis used as the selector. - label string
- The label of the SSH Key. Computed when
idis used as the selector. - ssh_
key string - The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
- created String
- The date this key was added.
- id String
- The ID of the SSH Key. Computed when
labelis used as the selector. - label String
- The label of the SSH Key. Computed when
idis used as the selector. - ssh
Key String - The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
- created string
- The date this key was added.
- id string
- The ID of the SSH Key. Computed when
labelis used as the selector. - label string
- The label of the SSH Key. Computed when
idis used as the selector. - ssh
Key string - The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
- created String
- The date this key was added.
- id String
- The ID of the SSH Key. Computed when
labelis used as the selector. - label String
- The label of the SSH Key. Computed when
idis used as the selector. - ssh
Key String - The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linodeTerraform Provider.
Viewing docs for Linode v6.8.0
published on Wednesday, Oct 21, 2026 by Pulumi
published on Wednesday, Oct 21, 2026 by Pulumi