1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. SshKey
spectrocloud 0.23.4 published on Monday, Apr 14, 2025 by spectrocloud

spectrocloud.SshKey

Explore with Pulumi AI

The SSH key resource allows you to manage SSH keys in Palette.

You can learn more about managing SSH keys in Palette by reviewing the SSH Keys guide.

The ssh_key resource will not generate an SSH key pair. You must provide the public key to an existing SSH key as a string value to the ssh_key attribute. Refer to the Generate Key with TLS Provider section for additonal guidance.

Example Usage

An example of creating an SSH key resource in Palette.

import * as pulumi from "@pulumi/pulumi";
import * as spectrocloud from "@pulumi/spectrocloud";

const sshTenant = new spectrocloud.SshKey("sshTenant", {
    context: "project",
    sshKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ.....",
});
Copy
import pulumi
import pulumi_spectrocloud as spectrocloud

ssh_tenant = spectrocloud.SshKey("sshTenant",
    context="project",
    ssh_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ.....")
Copy
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.NewSshKey(ctx, "sshTenant", &spectrocloud.SshKeyArgs{
			Context: pulumi.String("project"),
			SshKey:  pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ....."),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Spectrocloud = Pulumi.Spectrocloud;

return await Deployment.RunAsync(() => 
{
    var sshTenant = new Spectrocloud.SshKey("sshTenant", new()
    {
        Context = "project",
        SshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ.....",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.spectrocloud.SshKey;
import com.pulumi.spectrocloud.SshKeyArgs;
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) {
        var sshTenant = new SshKey("sshTenant", SshKeyArgs.builder()
            .context("project")
            .sshKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ.....")
            .build());

    }
}
Copy
resources:
  sshTenant:
    type: spectrocloud:SshKey
    properties:
      context: project
      sshKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ.....
Copy

The example below demonstrates how to create an SSH key resource in Palette with the context attribute set to tenant.

import * as pulumi from "@pulumi/pulumi";
import * as spectrocloud from "@pulumi/spectrocloud";

const sshTenant = new spectrocloud.SshKey("sshTenant", {
    context: "tenant",
    sshKey: _var.ssh_key_value,
});
Copy
import pulumi
import pulumi_spectrocloud as spectrocloud

ssh_tenant = spectrocloud.SshKey("sshTenant",
    context="tenant",
    ssh_key=var["ssh_key_value"])
Copy
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.NewSshKey(ctx, "sshTenant", &spectrocloud.SshKeyArgs{
			Context: pulumi.String("tenant"),
			SshKey:  pulumi.Any(_var.Ssh_key_value),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Spectrocloud = Pulumi.Spectrocloud;

return await Deployment.RunAsync(() => 
{
    var sshTenant = new Spectrocloud.SshKey("sshTenant", new()
    {
        Context = "tenant",
        SshKey = @var.Ssh_key_value,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.spectrocloud.SshKey;
import com.pulumi.spectrocloud.SshKeyArgs;
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) {
        var sshTenant = new SshKey("sshTenant", SshKeyArgs.builder()
            .context("tenant")
            .sshKey(var_.ssh_key_value())
            .build());

    }
}
Copy
resources:
  sshTenant:
    type: spectrocloud:SshKey
    properties:
      context: tenant
      sshKey: ${var.ssh_key_value}
Copy

Create SshKey Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SshKey(name: string, args: SshKeyArgs, opts?: CustomResourceOptions);
@overload
def SshKey(resource_name: str,
           args: SshKeyArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def SshKey(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           ssh_key: Optional[str] = None,
           context: Optional[str] = None,
           name: Optional[str] = None,
           ssh_key_id: Optional[str] = None,
           timeouts: Optional[SshKeyTimeoutsArgs] = None)
func NewSshKey(ctx *Context, name string, args SshKeyArgs, opts ...ResourceOption) (*SshKey, error)
public SshKey(string name, SshKeyArgs args, CustomResourceOptions? opts = null)
public SshKey(String name, SshKeyArgs args)
public SshKey(String name, SshKeyArgs args, CustomResourceOptions options)
type: spectrocloud:SshKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SshKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SshKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SshKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SshKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SshKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var sshKeyResource = new Spectrocloud.SshKey("sshKeyResource", new()
{
    SshKey = "string",
    Context = "string",
    Name = "string",
    SshKeyId = "string",
    Timeouts = new Spectrocloud.Inputs.SshKeyTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
});
Copy
example, err := spectrocloud.NewSshKey(ctx, "sshKeyResource", &spectrocloud.SshKeyArgs{
SshKey: pulumi.String("string"),
Context: pulumi.String("string"),
Name: pulumi.String("string"),
SshKeyId: pulumi.String("string"),
Timeouts: &.SshKeyTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
Copy
var sshKeyResource = new SshKey("sshKeyResource", SshKeyArgs.builder()
    .sshKey("string")
    .context("string")
    .name("string")
    .sshKeyId("string")
    .timeouts(SshKeyTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .build());
Copy
ssh_key_resource = spectrocloud.SshKey("sshKeyResource",
    ssh_key="string",
    context="string",
    name="string",
    ssh_key_id="string",
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    })
Copy
const sshKeyResource = new spectrocloud.SshKey("sshKeyResource", {
    sshKey: "string",
    context: "string",
    name: "string",
    sshKeyId: "string",
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
});
Copy
type: spectrocloud:SshKey
properties:
    context: string
    name: string
    sshKey: string
    sshKeyId: string
    timeouts:
        create: string
        delete: string
        update: string
Copy

SshKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SshKey resource accepts the following input properties:

SshKey This property is required. string
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
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.
Name string
The name of the SSH key resource.
SshKeyId string
The ID of this resource.
Timeouts SshKeyTimeouts
SshKey This property is required. string
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
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.
Name string
The name of the SSH key resource.
SshKeyId string
The ID of this resource.
Timeouts SshKeyTimeoutsArgs
sshKey This property is required. String
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
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.
name String
The name of the SSH key resource.
sshKeyId String
The ID of this resource.
timeouts SshKeyTimeouts
sshKey This property is required. string
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
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.
name string
The name of the SSH key resource.
sshKeyId string
The ID of this resource.
timeouts SshKeyTimeouts
ssh_key This property is required. str
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
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.
name str
The name of the SSH key resource.
ssh_key_id str
The ID of this resource.
timeouts SshKeyTimeoutsArgs
sshKey This property is required. String
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
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.
name String
The name of the SSH key resource.
sshKeyId String
The ID of this resource.
timeouts Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the SshKey resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SshKey Resource

Get an existing SshKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SshKeyState, opts?: CustomResourceOptions): SshKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        context: Optional[str] = None,
        name: Optional[str] = None,
        ssh_key: Optional[str] = None,
        ssh_key_id: Optional[str] = None,
        timeouts: Optional[SshKeyTimeoutsArgs] = None) -> SshKey
func GetSshKey(ctx *Context, name string, id IDInput, state *SshKeyState, opts ...ResourceOption) (*SshKey, error)
public static SshKey Get(string name, Input<string> id, SshKeyState? state, CustomResourceOptions? opts = null)
public static SshKey get(String name, Output<String> id, SshKeyState state, CustomResourceOptions options)
resources:  _:    type: spectrocloud:SshKey    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state 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.
Name string
The name of the SSH key resource.
SshKey string
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
SshKeyId string
The ID of this resource.
Timeouts SshKeyTimeouts
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.
Name string
The name of the SSH key resource.
SshKey string
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
SshKeyId string
The ID of this resource.
Timeouts SshKeyTimeoutsArgs
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.
name String
The name of the SSH key resource.
sshKey String
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
sshKeyId String
The ID of this resource.
timeouts SshKeyTimeouts
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.
name string
The name of the SSH key resource.
sshKey string
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
sshKeyId string
The ID of this resource.
timeouts SshKeyTimeouts
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.
name str
The name of the SSH key resource.
ssh_key str
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
ssh_key_id str
The ID of this resource.
timeouts SshKeyTimeoutsArgs
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.
name String
The name of the SSH key resource.
sshKey String
The SSH key value. This is the public key that will be used to access the cluster. Must be in the Authorized Keys format, such as ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ...
sshKeyId String
The ID of this resource.
timeouts Property Map

Supporting Types

SshKeyTimeouts
, SshKeyTimeoutsArgs

Create string
Delete string
Update string
Create string
Delete string
Update string
create String
delete String
update String
create string
delete string
update string
create str
delete str
update str
create String
delete String
update String

Package Details

Repository
spectrocloud spectrocloud/terraform-provider-spectrocloud
License
Notes
This Pulumi package is based on the spectrocloud Terraform Provider.