1. Packages
  2. Gcore Provider
  3. API Docs
  4. getCloudSshKey
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 exampleCloudSshKey = gcore.getCloudSshKey({
        projectId: 1,
        sshKeyId: "36a7a97a-0672-4911-8f2b-92cd4e5b0d91",
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    example_cloud_ssh_key = gcore.get_cloud_ssh_key(project_id=1,
        ssh_key_id="36a7a97a-0672-4911-8f2b-92cd4e5b0d91")
    
    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.LookupCloudSshKey(ctx, &gcore.LookupCloudSshKeyArgs{
    			ProjectId: pulumi.Float64Ref(1),
    			SshKeyId:  pulumi.StringRef("36a7a97a-0672-4911-8f2b-92cd4e5b0d91"),
    		}, 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 exampleCloudSshKey = Gcore.GetCloudSshKey.Invoke(new()
        {
            ProjectId = 1,
            SshKeyId = "36a7a97a-0672-4911-8f2b-92cd4e5b0d91",
        });
    
    });
    
    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.GetCloudSshKeyArgs;
    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 exampleCloudSshKey = GcoreFunctions.getCloudSshKey(GetCloudSshKeyArgs.builder()
                .projectId(1)
                .sshKeyId("36a7a97a-0672-4911-8f2b-92cd4e5b0d91")
                .build());
    
        }
    }
    
    variables:
      exampleCloudSshKey:
        fn::invoke:
          function: gcore:getCloudSshKey
          arguments:
            projectId: 1
            sshKeyId: 36a7a97a-0672-4911-8f2b-92cd4e5b0d91
    

    Using getCloudSshKey

    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 getCloudSshKey(args: GetCloudSshKeyArgs, opts?: InvokeOptions): Promise<GetCloudSshKeyResult>
    function getCloudSshKeyOutput(args: GetCloudSshKeyOutputArgs, opts?: InvokeOptions): Output<GetCloudSshKeyResult>
    def get_cloud_ssh_key(find_one_by: Optional[GetCloudSshKeyFindOneBy] = None,
                          project_id: Optional[float] = None,
                          ssh_key_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetCloudSshKeyResult
    def get_cloud_ssh_key_output(find_one_by: Optional[pulumi.Input[GetCloudSshKeyFindOneByArgs]] = None,
                          project_id: Optional[pulumi.Input[float]] = None,
                          ssh_key_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetCloudSshKeyResult]
    func LookupCloudSshKey(ctx *Context, args *LookupCloudSshKeyArgs, opts ...InvokeOption) (*LookupCloudSshKeyResult, error)
    func LookupCloudSshKeyOutput(ctx *Context, args *LookupCloudSshKeyOutputArgs, opts ...InvokeOption) LookupCloudSshKeyResultOutput

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

    public static class GetCloudSshKey 
    {
        public static Task<GetCloudSshKeyResult> InvokeAsync(GetCloudSshKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudSshKeyResult> Invoke(GetCloudSshKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCloudSshKeyResult> getCloudSshKey(GetCloudSshKeyArgs args, InvokeOptions options)
    public static Output<GetCloudSshKeyResult> getCloudSshKey(GetCloudSshKeyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getCloudSshKey:getCloudSshKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FindOneBy GetCloudSshKeyFindOneBy
    ProjectId double
    Project ID
    SshKeyId string
    SSH key ID
    FindOneBy GetCloudSshKeyFindOneBy
    ProjectId float64
    Project ID
    SshKeyId string
    SSH key ID
    findOneBy GetCloudSshKeyFindOneBy
    projectId Double
    Project ID
    sshKeyId String
    SSH key ID
    findOneBy GetCloudSshKeyFindOneBy
    projectId number
    Project ID
    sshKeyId string
    SSH key ID
    findOneBy Property Map
    projectId Number
    Project ID
    sshKeyId String
    SSH key ID

    getCloudSshKey Result

    The following output properties are available:

    CreatedAt string
    SSH key creation time
    Fingerprint string
    Fingerprint
    Id string
    SSH key ID
    Name string
    SSH key name
    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".
    FindOneBy GetCloudSshKeyFindOneBy
    ProjectId double
    Project ID
    SshKeyId string
    SSH key ID
    CreatedAt string
    SSH key creation time
    Fingerprint string
    Fingerprint
    Id string
    SSH key ID
    Name string
    SSH key name
    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".
    FindOneBy GetCloudSshKeyFindOneBy
    ProjectId float64
    Project ID
    SshKeyId string
    SSH key ID
    createdAt String
    SSH key creation time
    fingerprint String
    Fingerprint
    id String
    SSH key ID
    name String
    SSH key name
    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".
    findOneBy GetCloudSshKeyFindOneBy
    projectId Double
    Project ID
    sshKeyId String
    SSH key ID
    createdAt string
    SSH key creation time
    fingerprint string
    Fingerprint
    id string
    SSH key ID
    name string
    SSH key name
    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".
    findOneBy GetCloudSshKeyFindOneBy
    projectId number
    Project ID
    sshKeyId string
    SSH key ID
    created_at str
    SSH key creation time
    fingerprint str
    Fingerprint
    id str
    SSH key ID
    name str
    SSH key name
    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".
    find_one_by GetCloudSshKeyFindOneBy
    project_id float
    Project ID
    ssh_key_id str
    SSH key ID
    createdAt String
    SSH key creation time
    fingerprint String
    Fingerprint
    id String
    SSH key ID
    name String
    SSH key name
    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".
    findOneBy Property Map
    projectId Number
    Project ID
    sshKeyId String
    SSH key ID

    Supporting Types

    GetCloudSshKeyFindOneBy

    OrderBy string
    Sort order for the SSH keys Available values: "createdat.asc", "createdat.desc", "name.asc", "name.desc".
    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".
    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".
    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".
    name string
    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".
    name str
    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".
    name String
    SSH key name. Partial substring match. Example: name=abc matches any key containing abc in name.

    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.