1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. getSshKey
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

spectrocloud.getSshKey

Explore with Pulumi AI

spectrocloud logo
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

    The SSH key data source allows you to retrieve information about SSH keys in Palette.

    To learn more about SSH Keys in Palette, review the SSH Keys section of the documentation.

    Example Usage

    You can specify the context as project or tenant to get the SSH key from the respective context.

    Example with context as project.

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const sshProject = spectrocloud.getSshKey({
        context: "project",
        name: "test-tf-ssh",
    });
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    ssh_project = spectrocloud.get_ssh_key(context="project",
        name="test-tf-ssh")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := spectrocloud.LookupSshKey(ctx, &spectrocloud.LookupSshKeyArgs{
    			Context: pulumi.StringRef("project"),
    			Name:    pulumi.StringRef("test-tf-ssh"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var sshProject = Spectrocloud.GetSshKey.Invoke(new()
        {
            Context = "project",
            Name = "test-tf-ssh",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.SpectrocloudFunctions;
    import com.pulumi.spectrocloud.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 sshProject = SpectrocloudFunctions.getSshKey(GetSshKeyArgs.builder()
                .context("project")
                .name("test-tf-ssh")
                .build());
    
        }
    }
    
    variables:
      sshProject:
        fn::invoke:
          function: spectrocloud:getSshKey
          arguments:
            context: project
            name: test-tf-ssh
    

    Example with context as tenant.

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const sshProject = spectrocloud.getSshKey({
        context: "tenant",
        name: "global-tf-ssh",
    });
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    ssh_project = spectrocloud.get_ssh_key(context="tenant",
        name="global-tf-ssh")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := spectrocloud.LookupSshKey(ctx, &spectrocloud.LookupSshKeyArgs{
    			Context: pulumi.StringRef("tenant"),
    			Name:    pulumi.StringRef("global-tf-ssh"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var sshProject = Spectrocloud.GetSshKey.Invoke(new()
        {
            Context = "tenant",
            Name = "global-tf-ssh",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.SpectrocloudFunctions;
    import com.pulumi.spectrocloud.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 sshProject = SpectrocloudFunctions.getSshKey(GetSshKeyArgs.builder()
                .context("tenant")
                .name("global-tf-ssh")
                .build());
    
        }
    }
    
    variables:
      sshProject:
        fn::invoke:
          function: spectrocloud:getSshKey
          arguments:
            context: tenant
            name: global-tf-ssh
    

    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(context: Optional[str] = None,
                    id: Optional[str] = None,
                    name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetSshKeyResult
    def get_ssh_key_output(context: Optional[pulumi.Input[str]] = None,
                    id: Optional[pulumi.Input[str]] = None,
                    name: 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)
    public static Output<GetSshKeyResult> getSshKey(GetSshKeyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: spectrocloud:index/getSshKey:getSshKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Context string
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    Id string
    The Id of the SSH key resource.
    Name string
    The name of the SSH key resource.
    Context string
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    Id string
    The Id of the SSH key resource.
    Name string
    The name of the SSH key resource.
    context String
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The Id of the SSH key resource.
    name String
    The name of the SSH key resource.
    context string
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id string
    The Id of the SSH key resource.
    name string
    The name of the SSH key resource.
    context str
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id str
    The Id of the SSH key resource.
    name str
    The name of the SSH key resource.
    context String
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The Id of the SSH key resource.
    name String
    The name of the SSH key resource.

    getSshKey Result

    The following output properties are available:

    Id string
    The Id of the SSH key resource.
    Name string
    The name of the SSH key resource.
    SshKey string
    The SSH key value. This is the public key that was uploaded to Palette.
    Context string
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    Id string
    The Id of the SSH key resource.
    Name string
    The name of the SSH key resource.
    SshKey string
    The SSH key value. This is the public key that was uploaded to Palette.
    Context string
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The Id of the SSH key resource.
    name String
    The name of the SSH key resource.
    sshKey String
    The SSH key value. This is the public key that was uploaded to Palette.
    context String
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id string
    The Id of the SSH key resource.
    name string
    The name of the SSH key resource.
    sshKey string
    The SSH key value. This is the public key that was uploaded to Palette.
    context string
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id str
    The Id of the SSH key resource.
    name str
    The name of the SSH key resource.
    ssh_key str
    The SSH key value. This is the public key that was uploaded to Palette.
    context str
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The Id of the SSH key resource.
    name String
    The name of the SSH key resource.
    sshKey String
    The SSH key value. This is the public key that was uploaded to Palette.
    context String
    The context of the cluster profile. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.

    Package Details

    Repository
    spectrocloud spectrocloud/terraform-provider-spectrocloud
    License
    Notes
    This Pulumi package is based on the spectrocloud Terraform Provider.
    spectrocloud logo
    spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud