1. Packages
  2. Gcore Provider
  3. API Docs
  4. getCloudSshKeys
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 2026 by g-core
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 2026 by g-core

    SSH key pairs provide secure authentication to cloud instances, supporting both generated and imported public keys.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const exampleCloudSshKeys = gcore.getCloudSshKeys({
        projectId: 1,
        name: "my-ssh-key",
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    example_cloud_ssh_keys = gcore.get_cloud_ssh_keys(project_id=1,
        name="my-ssh-key")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/v2/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.GetCloudSshKeys(ctx, &gcore.GetCloudSshKeysArgs{
    			ProjectId: pulumi.Float64Ref(1),
    			Name:      pulumi.StringRef("my-ssh-key"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleCloudSshKeys = Gcore.GetCloudSshKeys.Invoke(new()
        {
            ProjectId = 1,
            Name = "my-ssh-key",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetCloudSshKeysArgs;
    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 exampleCloudSshKeys = GcoreFunctions.getCloudSshKeys(GetCloudSshKeysArgs.builder()
                .projectId(1)
                .name("my-ssh-key")
                .build());
    
        }
    }
    
    variables:
      exampleCloudSshKeys:
        fn::invoke:
          function: gcore:getCloudSshKeys
          arguments:
            projectId: 1
            name: my-ssh-key
    

    Using getCloudSshKeys

    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 getCloudSshKeys(args: GetCloudSshKeysArgs, opts?: InvokeOptions): Promise<GetCloudSshKeysResult>
    function getCloudSshKeysOutput(args: GetCloudSshKeysOutputArgs, opts?: InvokeOptions): Output<GetCloudSshKeysResult>
    def get_cloud_ssh_keys(max_items: Optional[float] = None,
                           name: Optional[str] = None,
                           order_by: Optional[str] = None,
                           project_id: Optional[float] = None,
                           opts: Optional[InvokeOptions] = None) -> GetCloudSshKeysResult
    def get_cloud_ssh_keys_output(max_items: Optional[pulumi.Input[float]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           order_by: Optional[pulumi.Input[str]] = None,
                           project_id: Optional[pulumi.Input[float]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetCloudSshKeysResult]
    func GetCloudSshKeys(ctx *Context, args *GetCloudSshKeysArgs, opts ...InvokeOption) (*GetCloudSshKeysResult, error)
    func GetCloudSshKeysOutput(ctx *Context, args *GetCloudSshKeysOutputArgs, opts ...InvokeOption) GetCloudSshKeysResultOutput

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

    public static class GetCloudSshKeys 
    {
        public static Task<GetCloudSshKeysResult> InvokeAsync(GetCloudSshKeysArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudSshKeysResult> Invoke(GetCloudSshKeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCloudSshKeysResult> getCloudSshKeys(GetCloudSshKeysArgs args, InvokeOptions options)
    public static Output<GetCloudSshKeysResult> getCloudSshKeys(GetCloudSshKeysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getCloudSshKeys:getCloudSshKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    MaxItems double
    Max items to fetch, default: 1000
    Name string
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    OrderBy string
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    ProjectId double
    Project ID
    MaxItems float64
    Max items to fetch, default: 1000
    Name string
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    OrderBy string
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    ProjectId float64
    Project ID
    maxItems Double
    Max items to fetch, default: 1000
    name String
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    orderBy String
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    projectId Double
    Project ID
    maxItems number
    Max items to fetch, default: 1000
    name string
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    orderBy string
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    projectId number
    Project ID
    max_items float
    Max items to fetch, default: 1000
    name str
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    order_by str
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    project_id float
    Project ID
    maxItems Number
    Max items to fetch, default: 1000
    name String
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    orderBy String
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    projectId Number
    Project ID

    getCloudSshKeys Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Items List<GetCloudSshKeysItem>
    The items returned by the data source
    OrderBy string
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    MaxItems double
    Max items to fetch, default: 1000
    Name string
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    ProjectId double
    Project ID
    Id string
    The provider-assigned unique ID for this managed resource.
    Items []GetCloudSshKeysItem
    The items returned by the data source
    OrderBy string
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    MaxItems float64
    Max items to fetch, default: 1000
    Name string
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    ProjectId float64
    Project ID
    id String
    The provider-assigned unique ID for this managed resource.
    items List<GetCloudSshKeysItem>
    The items returned by the data source
    orderBy String
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    maxItems Double
    Max items to fetch, default: 1000
    name String
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    projectId Double
    Project ID
    id string
    The provider-assigned unique ID for this managed resource.
    items GetCloudSshKeysItem[]
    The items returned by the data source
    orderBy string
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    maxItems number
    Max items to fetch, default: 1000
    name string
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    projectId number
    Project ID
    id str
    The provider-assigned unique ID for this managed resource.
    items Sequence[GetCloudSshKeysItem]
    The items returned by the data source
    order_by str
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    max_items float
    Max items to fetch, default: 1000
    name str
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    project_id float
    Project ID
    id String
    The provider-assigned unique ID for this managed resource.
    items List<Property Map>
    The items returned by the data source
    orderBy String
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    maxItems Number
    Max items to fetch, default: 1000
    name String
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.
    projectId Number
    Project ID

    Supporting Types

    GetCloudSshKeysItem

    CreatedAt string
    SSH key creation time
    Fingerprint string
    Fingerprint
    Id string
    SSH key ID
    Name string
    SSH key name
    ProjectId double
    Project ID
    PublicKey string
    The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.
    SharedInProject bool
    SSH key will be visible to all users in the project
    State string
    SSH key state Available values: "ACTIVE", "DELETING".
    CreatedAt string
    SSH key creation time
    Fingerprint string
    Fingerprint
    Id string
    SSH key ID
    Name string
    SSH key name
    ProjectId float64
    Project ID
    PublicKey string
    The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.
    SharedInProject bool
    SSH key will be visible to all users in the project
    State string
    SSH key state Available values: "ACTIVE", "DELETING".
    createdAt String
    SSH key creation time
    fingerprint String
    Fingerprint
    id String
    SSH key ID
    name String
    SSH key name
    projectId Double
    Project ID
    publicKey String
    The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.
    sharedInProject Boolean
    SSH key will be visible to all users in the project
    state String
    SSH key state Available values: "ACTIVE", "DELETING".
    createdAt string
    SSH key creation time
    fingerprint string
    Fingerprint
    id string
    SSH key ID
    name string
    SSH key name
    projectId number
    Project ID
    publicKey string
    The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.
    sharedInProject boolean
    SSH key will be visible to all users in the project
    state string
    SSH key state Available values: "ACTIVE", "DELETING".
    created_at str
    SSH key creation time
    fingerprint str
    Fingerprint
    id str
    SSH key ID
    name str
    SSH key name
    project_id float
    Project ID
    public_key str
    The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.
    shared_in_project bool
    SSH key will be visible to all users in the project
    state str
    SSH key state Available values: "ACTIVE", "DELETING".
    createdAt String
    SSH key creation time
    fingerprint String
    Fingerprint
    id String
    SSH key ID
    name String
    SSH key name
    projectId Number
    Project ID
    publicKey String
    The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.
    sharedInProject Boolean
    SSH key will be visible to all users in the project
    state String
    SSH key state Available values: "ACTIVE", "DELETING".

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    Viewing docs for gcore 2.0.0-alpha.3
    published on Monday, Mar 30, 2026 by g-core
      Try Pulumi Cloud free. Your team will thank you.