1. Packages
  2. Linode
  3. API Docs
  4. getSshKey
Linode v4.22.0 published on Tuesday, Jun 25, 2024 by Pulumi

linode.getSshKey

Explore with Pulumi AI

linode logo
Linode v4.22.0 published on Tuesday, Jun 25, 2024 by Pulumi

    linode.SshKey provides access to a specifically labeled SSH Key in the Profile of the User identified by the access token.

    Example Usage

    The following example shows how the resource might be used to obtain the name of the 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",
    });
    
    import pulumi
    import pulumi_linode as linode
    
    foo = linode.get_ssh_key(label="foo")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := linode.LookupSshKey(ctx, &linode.LookupSshKeyArgs{
    			Label: "foo",
    		}, 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",
        });
    
    });
    
    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.List;
    import java.util.ArrayList;
    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());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: linode:getSshKey
          Arguments:
            label: foo
    

    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?: InvokeOptions): 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: Optional[pulumi.Input[str]] = None,
                    label: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = 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 CompletableFuture<GetSshKeyResult> getSshKey(GetSshKeyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getSshKey:getSshKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Label string
    The label of the SSH Key to select.
    Id string
    The ID of the SSH Key
    Label string
    The label of the SSH Key to select.
    Id string
    The ID of the SSH Key
    label String
    The label of the SSH Key to select.
    id String
    The ID of the SSH Key
    label string
    The label of the SSH Key to select.
    id string
    The ID of the SSH Key
    label str
    The label of the SSH Key to select.
    id str
    The ID of the SSH Key
    label String
    The label of the SSH Key to select.
    id String
    The ID of the SSH Key

    getSshKey Result

    The following output properties are available:

    Created string
    The date this key was added.
    Label string
    SshKey string
    The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
    Id string
    The ID of the SSH Key
    Created string
    The date this key was added.
    Label string
    SshKey string
    The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
    Id string
    The ID of the SSH Key
    created String
    The date this key was added.
    label String
    sshKey String
    The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
    id String
    The ID of the SSH Key
    created string
    The date this key was added.
    label string
    sshKey string
    The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
    id string
    The ID of the SSH Key
    created str
    The date this key was added.
    label str
    ssh_key str
    The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
    id str
    The ID of the SSH Key
    created String
    The date this key was added.
    label String
    sshKey String
    The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
    id String
    The ID of the SSH Key

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.22.0 published on Tuesday, Jun 25, 2024 by Pulumi