1. Packages
  2. Packages
  3. OVH
  4. API Docs
  5. getCloudSshKey
Viewing docs for OVHCloud v2.17.0
published on Friday, Jul 17, 2026 by OVHcloud
ovh logo
Viewing docs for OVHCloud v2.17.0
published on Friday, Jul 17, 2026 by OVHcloud

    This data source uses a Beta API. Use this data source to retrieve information about a single SSH key of a Public Cloud project (API v2), looked up by its name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const myKey = ovh.getCloudSshKey({
        serviceName: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
        name: "my-deploy-key",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    my_key = ovh.get_cloud_ssh_key(service_name="aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
        name="my-deploy-key")
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ovh.GetCloudSshKey(ctx, &ovh.GetCloudSshKeyArgs{
    			ServiceName: pulumi.StringRef("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
    			Name:        "my-deploy-key",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var myKey = Ovh.GetCloudSshKey.Invoke(new()
        {
            ServiceName = "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
            Name = "my-deploy-key",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.OvhFunctions;
    import com.pulumi.ovh.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 myKey = OvhFunctions.getCloudSshKey(GetCloudSshKeyArgs.builder()
                .serviceName("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
                .name("my-deploy-key")
                .build());
    
        }
    }
    
    variables:
      myKey:
        fn::invoke:
          function: ovh:getCloudSshKey
          arguments:
            serviceName: aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
            name: my-deploy-key
    
    Example coming soon!
    

    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(name: Optional[str] = None,
                          service_name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetCloudSshKeyResult
    def get_cloud_ssh_key_output(name: pulumi.Input[Optional[str]] = None,
                          service_name: pulumi.Input[Optional[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetCloudSshKeyResult]
    func GetCloudSshKey(ctx *Context, args *GetCloudSshKeyArgs, opts ...InvokeOption) (*GetCloudSshKeyResult, error)
    func GetCloudSshKeyOutput(ctx *Context, args *GetCloudSshKeyOutputArgs, opts ...InvokeOption) GetCloudSshKeyResultOutput

    > Note: This function is named GetCloudSshKey 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: ovh:index/getCloudSshKey:getCloudSshKey
      arguments:
        # arguments dictionary
    data "ovh_getcloudsshkey" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    Name of the SSH key to retrieve. SSH key names are unique within a project.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    Name string
    Name of the SSH key to retrieve. SSH key names are unique within a project.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    name string
    Name of the SSH key to retrieve. SSH key names are unique within a project.
    service_name string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    name String
    Name of the SSH key to retrieve. SSH key names are unique within a project.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    name string
    Name of the SSH key to retrieve. SSH key names are unique within a project.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    name str
    Name of the SSH key to retrieve. SSH key names are unique within a project.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    name String
    Name of the SSH key to retrieve. SSH key names are unique within a project.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

    getCloudSshKey Result

    The following output properties are available:

    CreatedAt string
    Creation date of the SSH key (RFC 3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    SSH key name.
    PublicKey string
    SSH public key content.
    UpdatedAt string
    Last update date of the SSH key (RFC 3339 format).
    ServiceName string
    The id of the public cloud project.
    CreatedAt string
    Creation date of the SSH key (RFC 3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    SSH key name.
    PublicKey string
    SSH public key content.
    UpdatedAt string
    Last update date of the SSH key (RFC 3339 format).
    ServiceName string
    The id of the public cloud project.
    created_at string
    Creation date of the SSH key (RFC 3339 format).
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    SSH key name.
    public_key string
    SSH public key content.
    updated_at string
    Last update date of the SSH key (RFC 3339 format).
    service_name string
    The id of the public cloud project.
    createdAt String
    Creation date of the SSH key (RFC 3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    SSH key name.
    publicKey String
    SSH public key content.
    updatedAt String
    Last update date of the SSH key (RFC 3339 format).
    serviceName String
    The id of the public cloud project.
    createdAt string
    Creation date of the SSH key (RFC 3339 format).
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    SSH key name.
    publicKey string
    SSH public key content.
    updatedAt string
    Last update date of the SSH key (RFC 3339 format).
    serviceName string
    The id of the public cloud project.
    created_at str
    Creation date of the SSH key (RFC 3339 format).
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    SSH key name.
    public_key str
    SSH public key content.
    updated_at str
    Last update date of the SSH key (RFC 3339 format).
    service_name str
    The id of the public cloud project.
    createdAt String
    Creation date of the SSH key (RFC 3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    SSH key name.
    publicKey String
    SSH public key content.
    updatedAt String
    Last update date of the SSH key (RFC 3339 format).
    serviceName String
    The id of the public cloud project.

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    Viewing docs for OVHCloud v2.17.0
    published on Friday, Jul 17, 2026 by OVHcloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial