1. Packages
  2. Linode Provider
  3. API Docs
  4. getSshkeys
Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi

linode.getSshkeys

Explore with Pulumi AI

linode logo
Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi

    linode.SshKey provides access to a filtered list of SSH Keys 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 the resource might be used to obtain the names of the SSH Keys configured on the Linode user profile.

    The following example shows how one might use this data source to access information about a Linode Kernel.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const filteredSsh = linode.getSshkeys({
        filters: [
            {
                name: "label",
                values: ["my-ssh"],
            },
            {
                name: "ssh_key",
                values: ["RSA-6522525"],
            },
        ],
    });
    
    import pulumi
    import pulumi_linode as linode
    
    filtered_ssh = linode.get_sshkeys(filters=[
        {
            "name": "label",
            "values": ["my-ssh"],
        },
        {
            "name": "ssh_key",
            "values": ["RSA-6522525"],
        },
    ])
    
    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.GetSshkeys(ctx, &linode.GetSshkeysArgs{
    			Filters: []linode.GetSshkeysFilter{
    				{
    					Name: "label",
    					Values: []string{
    						"my-ssh",
    					},
    				},
    				{
    					Name: "ssh_key",
    					Values: []string{
    						"RSA-6522525",
    					},
    				},
    			},
    		}, 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 filteredSsh = Linode.GetSshkeys.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetSshkeysFilterInputArgs
                {
                    Name = "label",
                    Values = new[]
                    {
                        "my-ssh",
                    },
                },
                new Linode.Inputs.GetSshkeysFilterInputArgs
                {
                    Name = "ssh_key",
                    Values = new[]
                    {
                        "RSA-6522525",
                    },
                },
            },
        });
    
    });
    
    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.GetSshkeysArgs;
    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 filteredSsh = LinodeFunctions.getSshkeys(GetSshkeysArgs.builder()
                .filters(            
                    GetSshkeysFilterArgs.builder()
                        .name("label")
                        .values("my-ssh")
                        .build(),
                    GetSshkeysFilterArgs.builder()
                        .name("ssh_key")
                        .values("RSA-6522525")
                        .build())
                .build());
    
        }
    }
    
    variables:
      filteredSsh:
        fn::invoke:
          Function: linode:getSshkeys
          Arguments:
            filters:
              - name: label
                values:
                  - my-ssh
              - name: ssh_key
                values:
                  - RSA-6522525
    

    Filterable Fields

    • id

    • label

    • ssh_key

    Using getSshkeys

    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 getSshkeys(args: GetSshkeysArgs, opts?: InvokeOptions): Promise<GetSshkeysResult>
    function getSshkeysOutput(args: GetSshkeysOutputArgs, opts?: InvokeOptions): Output<GetSshkeysResult>
    def get_sshkeys(filters: Optional[Sequence[GetSshkeysFilter]] = None,
                    order: Optional[str] = None,
                    order_by: Optional[str] = None,
                    sshkeys: Optional[Sequence[GetSshkeysSshkey]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetSshkeysResult
    def get_sshkeys_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSshkeysFilterArgs]]]] = None,
                    order: Optional[pulumi.Input[str]] = None,
                    order_by: Optional[pulumi.Input[str]] = None,
                    sshkeys: Optional[pulumi.Input[Sequence[pulumi.Input[GetSshkeysSshkeyArgs]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetSshkeysResult]
    func GetSshkeys(ctx *Context, args *GetSshkeysArgs, opts ...InvokeOption) (*GetSshkeysResult, error)
    func GetSshkeysOutput(ctx *Context, args *GetSshkeysOutputArgs, opts ...InvokeOption) GetSshkeysResultOutput

    > Note: This function is named GetSshkeys in the Go SDK.

    public static class GetSshkeys 
    {
        public static Task<GetSshkeysResult> InvokeAsync(GetSshkeysArgs args, InvokeOptions? opts = null)
        public static Output<GetSshkeysResult> Invoke(GetSshkeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSshkeysResult> getSshkeys(GetSshkeysArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getSshkeys:getSshkeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetSshkeysFilter>
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Sshkeys List<GetSshkeysSshkey>
    Filters []GetSshkeysFilter
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Sshkeys []GetSshkeysSshkey
    filters List<GetSshkeysFilter>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    sshkeys List<GetSshkeysSshkey>
    filters GetSshkeysFilter[]
    order string
    The order in which results should be returned. (asc, desc; default asc)
    orderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    sshkeys GetSshkeysSshkey[]
    filters Sequence[GetSshkeysFilter]
    order str
    The order in which results should be returned. (asc, desc; default asc)
    order_by str
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    sshkeys Sequence[GetSshkeysSshkey]
    filters List<Property Map>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    sshkeys List<Property Map>

    getSshkeys Result

    The following output properties are available:

    Id string
    The ID of the SSH Key.
    Filters []GetSshkeysFilter
    Order string
    OrderBy string
    Sshkeys []GetSshkeysSshkey
    id string
    The ID of the SSH Key.
    filters GetSshkeysFilter[]
    order string
    orderBy string
    sshkeys GetSshkeysSshkey[]
    id String
    The ID of the SSH Key.
    filters List<Property Map>
    order String
    orderBy String
    sshkeys List<Property Map>

    Supporting Types

    GetSshkeysFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetSshkeysSshkey

    Created string
    The date this key was added.
    Label string
    The label of the SSH Key.
    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
    The label of the SSH Key.
    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
    The label of the SSH Key.
    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
    The label of the SSH Key.
    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
    The label of the SSH Key.
    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
    The label of the SSH Key.
    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.30.0 published on Friday, Nov 8, 2024 by Pulumi