1. Packages
  2. Packages
  3. Selectel Provider
  4. API Docs
  5. DedicatedSshKeysV1
Viewing docs for selectel 8.0.1
published on Thursday, May 28, 2026 by selectel
Viewing docs for selectel 8.0.1
published on Thursday, May 28, 2026 by selectel

    Adds and manages a public SSH key for dedicated servers using public API v1. For more information how to create an SSH key pair, see the official Selectel documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const sshKey1 = new selectel.DedicatedSshKeysV1("ssh_key_1", {
        name: "ssh_key_1",
        publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...",
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    ssh_key1 = selectel.DedicatedSshKeysV1("ssh_key_1",
        name="ssh_key_1",
        public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v8/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := selectel.NewDedicatedSshKeysV1(ctx, "ssh_key_1", &selectel.DedicatedSshKeysV1Args{
    			Name:      pulumi.String("ssh_key_1"),
    			PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD..."),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var sshKey1 = new Selectel.DedicatedSshKeysV1("ssh_key_1", new()
        {
            Name = "ssh_key_1",
            PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.DedicatedSshKeysV1;
    import com.pulumi.selectel.DedicatedSshKeysV1Args;
    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 sshKey1 = new DedicatedSshKeysV1("sshKey1", DedicatedSshKeysV1Args.builder()
                .name("ssh_key_1")
                .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...")
                .build());
    
        }
    }
    
    resources:
      sshKey1:
        type: selectel:DedicatedSshKeysV1
        name: ssh_key_1
        properties:
          name: ssh_key_1
          publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...
    
    Example coming soon!
    

    Create DedicatedSshKeysV1 Resource

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

    Constructor syntax

    new DedicatedSshKeysV1(name: string, args: DedicatedSshKeysV1Args, opts?: CustomResourceOptions);
    @overload
    def DedicatedSshKeysV1(resource_name: str,
                           args: DedicatedSshKeysV1Args,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def DedicatedSshKeysV1(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           public_key: Optional[str] = None,
                           name: Optional[str] = None,
                           user_id: Optional[str] = None)
    func NewDedicatedSshKeysV1(ctx *Context, name string, args DedicatedSshKeysV1Args, opts ...ResourceOption) (*DedicatedSshKeysV1, error)
    public DedicatedSshKeysV1(string name, DedicatedSshKeysV1Args args, CustomResourceOptions? opts = null)
    public DedicatedSshKeysV1(String name, DedicatedSshKeysV1Args args)
    public DedicatedSshKeysV1(String name, DedicatedSshKeysV1Args args, CustomResourceOptions options)
    
    type: selectel:DedicatedSshKeysV1
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "selectel_dedicatedsshkeysv1" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args DedicatedSshKeysV1Args
    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 DedicatedSshKeysV1Args
    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 DedicatedSshKeysV1Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DedicatedSshKeysV1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DedicatedSshKeysV1Args
    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 dedicatedSshKeysV1Resource = new Selectel.DedicatedSshKeysV1("dedicatedSshKeysV1Resource", new()
    {
        PublicKey = "string",
        Name = "string",
        UserId = "string",
    });
    
    example, err := selectel.NewDedicatedSshKeysV1(ctx, "dedicatedSshKeysV1Resource", &selectel.DedicatedSshKeysV1Args{
    	PublicKey: pulumi.String("string"),
    	Name:      pulumi.String("string"),
    	UserId:    pulumi.String("string"),
    })
    
    resource "selectel_dedicatedsshkeysv1" "dedicatedSshKeysV1Resource" {
      public_key = "string"
      name       = "string"
      user_id    = "string"
    }
    
    var dedicatedSshKeysV1Resource = new DedicatedSshKeysV1("dedicatedSshKeysV1Resource", DedicatedSshKeysV1Args.builder()
        .publicKey("string")
        .name("string")
        .userId("string")
        .build());
    
    dedicated_ssh_keys_v1_resource = selectel.DedicatedSshKeysV1("dedicatedSshKeysV1Resource",
        public_key="string",
        name="string",
        user_id="string")
    
    const dedicatedSshKeysV1Resource = new selectel.DedicatedSshKeysV1("dedicatedSshKeysV1Resource", {
        publicKey: "string",
        name: "string",
        userId: "string",
    });
    
    type: selectel:DedicatedSshKeysV1
    properties:
        name: string
        publicKey: string
        userId: string
    

    DedicatedSshKeysV1 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 DedicatedSshKeysV1 resource accepts the following input properties:

    PublicKey string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    Name string
    Name of the SSH key. Changing this creates a new SSH key.
    UserId string
    PublicKey string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    Name string
    Name of the SSH key. Changing this creates a new SSH key.
    UserId string
    public_key string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    name string
    Name of the SSH key. Changing this creates a new SSH key.
    user_id string
    publicKey String
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    name String
    Name of the SSH key. Changing this creates a new SSH key.
    userId String
    publicKey string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    name string
    Name of the SSH key. Changing this creates a new SSH key.
    userId string
    public_key str
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    name str
    Name of the SSH key. Changing this creates a new SSH key.
    user_id str
    publicKey String
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    name String
    Name of the SSH key. Changing this creates a new SSH key.
    userId String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DedicatedSshKeysV1 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 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 DedicatedSshKeysV1 Resource

    Get an existing DedicatedSshKeysV1 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?: DedicatedSshKeysV1State, opts?: CustomResourceOptions): DedicatedSshKeysV1
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            public_key: Optional[str] = None,
            user_id: Optional[str] = None) -> DedicatedSshKeysV1
    func GetDedicatedSshKeysV1(ctx *Context, name string, id IDInput, state *DedicatedSshKeysV1State, opts ...ResourceOption) (*DedicatedSshKeysV1, error)
    public static DedicatedSshKeysV1 Get(string name, Input<string> id, DedicatedSshKeysV1State? state, CustomResourceOptions? opts = null)
    public static DedicatedSshKeysV1 get(String name, Output<String> id, DedicatedSshKeysV1State state, CustomResourceOptions options)
    resources:  _:    type: selectel:DedicatedSshKeysV1    get:      id: ${id}
    import {
      to = selectel_dedicatedsshkeysv1.example
      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.
    The following state arguments are supported:
    Name string
    Name of the SSH key. Changing this creates a new SSH key.
    PublicKey string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    UserId string
    Name string
    Name of the SSH key. Changing this creates a new SSH key.
    PublicKey string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    UserId string
    name string
    Name of the SSH key. Changing this creates a new SSH key.
    public_key string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    user_id string
    name String
    Name of the SSH key. Changing this creates a new SSH key.
    publicKey String
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    userId String
    name string
    Name of the SSH key. Changing this creates a new SSH key.
    publicKey string
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    userId string
    name str
    Name of the SSH key. Changing this creates a new SSH key.
    public_key str
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    user_id str
    name String
    Name of the SSH key. Changing this creates a new SSH key.
    publicKey String
    Public SSH key string. Changing this creates a new SSH key. Leading and trailing whitespace is ignored.
    userId String

    Import

    You can import an SSH public key:

    bash

    $ pulumi import selectel:index/dedicatedSshKeysV1:DedicatedSshKeysV1 ssh_key_1 <ssh_key_name>
    

    where:

    • <ssh_key_name> — Name of the SSH key. If multiple SSH keys with the same name exist, the first one found will be imported. We recommend to use unique names for SSH keys.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    selectel selectel/terraform-provider-selectel
    License
    Notes
    This Pulumi package is based on the selectel Terraform Provider.
    Viewing docs for selectel 8.0.1
    published on Thursday, May 28, 2026 by selectel

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial