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 thessh_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.....",
});
import pulumi
import pulumi_spectrocloud as spectrocloud
ssh_tenant = spectrocloud.SshKey("sshTenant",
context="project",
ssh_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ.....")
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
})
}
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.....",
});
});
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());
}
}
resources:
sshTenant:
type: spectrocloud:SshKey
properties:
context: project
sshKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ.....
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,
});
import pulumi
import pulumi_spectrocloud as spectrocloud
ssh_tenant = spectrocloud.SshKey("sshTenant",
context="tenant",
ssh_key=var["ssh_key_value"])
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
})
}
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,
});
});
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());
}
}
resources:
sshTenant:
type: spectrocloud:SshKey
properties:
context: tenant
sshKey: ${var.ssh_key_value}
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 string
- The unique name of the resource.
- args SshKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args SshKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SshKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
},
});
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: &spectrocloud.SshKeyTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
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());
ssh_key_resource = spectrocloud.SshKey("sshKeyResource",
ssh_key="string",
context="string",
name="string",
ssh_key_id="string",
timeouts={
"create": "string",
"delete": "string",
"update": "string",
})
const sshKeyResource = new spectrocloud.SshKey("sshKeyResource", {
sshKey: "string",
context: "string",
name: "string",
sshKeyId: "string",
timeouts: {
create: "string",
"delete": "string",
update: "string",
},
});
type: spectrocloud:SshKey
properties:
context: string
name: string
sshKey: string
sshKeyId: string
timeouts:
create: string
delete: string
update: string
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:
- Ssh
Key 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
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - Name string
- The name of the SSH key resource.
- Ssh
Key stringId - The ID of this resource.
- Timeouts
Ssh
Key Timeouts
- Ssh
Key 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
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - Name string
- The name of the SSH key resource.
- Ssh
Key stringId - The ID of this resource.
- Timeouts
Ssh
Key Timeouts Args
- ssh
Key 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
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - name String
- The name of the SSH key resource.
- ssh
Key StringId - The ID of this resource.
- timeouts
Ssh
Key Timeouts
- ssh
Key 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
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - name string
- The name of the SSH key resource.
- ssh
Key stringId - The ID of this resource.
- timeouts
Ssh
Key Timeouts
- 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...
- context str
- The context of the cluster profile. Allowed values are
project
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - name str
- The name of the SSH key resource.
- ssh_
key_ strid - The ID of this resource.
- timeouts
Ssh
Key Timeouts Args
- ssh
Key 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
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - name String
- The name of the SSH key resource.
- ssh
Key StringId - 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Context string
- The context of the cluster profile. Allowed values are
project
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - Name string
- The name of the SSH key resource.
- Ssh
Key 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...
- Ssh
Key stringId - The ID of this resource.
- Timeouts
Ssh
Key Timeouts
- Context string
- The context of the cluster profile. Allowed values are
project
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - Name string
- The name of the SSH key resource.
- Ssh
Key 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...
- Ssh
Key stringId - The ID of this resource.
- Timeouts
Ssh
Key Timeouts Args
- context String
- The context of the cluster profile. Allowed values are
project
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - name String
- The name of the SSH key resource.
- ssh
Key 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...
- ssh
Key StringId - The ID of this resource.
- timeouts
Ssh
Key Timeouts
- context string
- The context of the cluster profile. Allowed values are
project
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - name string
- The name of the SSH key resource.
- ssh
Key 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...
- ssh
Key stringId - The ID of this resource.
- timeouts
Ssh
Key Timeouts
- context str
- The context of the cluster profile. Allowed values are
project
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_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_ strid - The ID of this resource.
- timeouts
Ssh
Key Timeouts Args
- context String
- The context of the cluster profile. Allowed values are
project
ortenant
. Default value isproject
. If theproject
context is specified, the project name will sourced from the provider configuration parameterproject_name
. - name String
- The name of the SSH key resource.
- ssh
Key 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...
- ssh
Key StringId - The ID of this resource.
- timeouts Property Map
Supporting Types
SshKeyTimeouts, SshKeyTimeoutsArgs
Package Details
- Repository
- spectrocloud spectrocloud/terraform-provider-spectrocloud
- License
- Notes
- This Pulumi package is based on the
spectrocloud
Terraform Provider.