vultr.SSHKey
Explore with Pulumi AI
Provides a Vultr SSH key resource. This can be used to create, read, modify, and delete SSH keys.
Example Usage
Create an SSH key
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";
const mySshKey = new vultr.SSHKey("mySshKey", {sshKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyVGaw1PuEl98f4/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz/bD/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWmDKljtv1dmSBCrTmEAQaOorxqGGBYmZS7NQumRe4lav5r6wOs8OACMANE1ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUzzjl1Jwku3bnRaCcjaxH8oTumt1a00mWci/1qUlaVFft085yvVq7KZbF2OPPbl+erDW91+EZ2FgEi+v1/CSJ5 your_username@hostname"});
import pulumi
import ediri_vultr as vultr
my_ssh_key = vultr.SSHKey("mySshKey", ssh_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyVGaw1PuEl98f4/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz/bD/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWmDKljtv1dmSBCrTmEAQaOorxqGGBYmZS7NQumRe4lav5r6wOs8OACMANE1ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUzzjl1Jwku3bnRaCcjaxH8oTumt1a00mWci/1qUlaVFft085yvVq7KZbF2OPPbl+erDW91+EZ2FgEi+v1/CSJ5 your_username@hostname")
package main
import (
"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vultr.NewSSHKey(ctx, "mySshKey", &vultr.SSHKeyArgs{
SshKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyVGaw1PuEl98f4/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz/bD/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWmDKljtv1dmSBCrTmEAQaOorxqGGBYmZS7NQumRe4lav5r6wOs8OACMANE1ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUzzjl1Jwku3bnRaCcjaxH8oTumt1a00mWci/1qUlaVFft085yvVq7KZbF2OPPbl+erDW91+EZ2FgEi+v1/CSJ5 your_username@hostname"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = ediri.Vultr;
return await Deployment.RunAsync(() =>
{
var mySshKey = new Vultr.SSHKey("mySshKey", new()
{
SshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyVGaw1PuEl98f4/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz/bD/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWmDKljtv1dmSBCrTmEAQaOorxqGGBYmZS7NQumRe4lav5r6wOs8OACMANE1ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUzzjl1Jwku3bnRaCcjaxH8oTumt1a00mWci/1qUlaVFft085yvVq7KZbF2OPPbl+erDW91+EZ2FgEi+v1/CSJ5 your_username@hostname",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.SSHKey;
import com.pulumi.vultr.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 mySshKey = new SSHKey("mySshKey", SSHKeyArgs.builder()
.sshKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyVGaw1PuEl98f4/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz/bD/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWmDKljtv1dmSBCrTmEAQaOorxqGGBYmZS7NQumRe4lav5r6wOs8OACMANE1ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUzzjl1Jwku3bnRaCcjaxH8oTumt1a00mWci/1qUlaVFft085yvVq7KZbF2OPPbl+erDW91+EZ2FgEi+v1/CSJ5 your_username@hostname")
.build());
}
}
resources:
mySshKey:
type: vultr:SSHKey
properties:
sshKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyVGaw1PuEl98f4/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz/bD/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWmDKljtv1dmSBCrTmEAQaOorxqGGBYmZS7NQumRe4lav5r6wOs8OACMANE1ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUzzjl1Jwku3bnRaCcjaxH8oTumt1a00mWci/1qUlaVFft085yvVq7KZbF2OPPbl+erDW91+EZ2FgEi+v1/CSJ5 your_username@hostname
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,
name: Optional[str] = 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: vultr: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 Vultr.SSHKey("sshkeyResource", new()
{
SshKey = "string",
Name = "string",
});
example, err := vultr.NewSSHKey(ctx, "sshkeyResource", &vultr.SSHKeyArgs{
SshKey: pulumi.String("string"),
Name: pulumi.String("string"),
})
var sshkeyResource = new SSHKey("sshkeyResource", SSHKeyArgs.builder()
.sshKey("string")
.name("string")
.build());
sshkey_resource = vultr.SSHKey("sshkeyResource",
ssh_key="string",
name="string")
const sshkeyResource = new vultr.SSHKey("sshkeyResource", {
sshKey: "string",
name: "string",
});
type: vultr:SSHKey
properties:
name: string
sshKey: 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:
Outputs
All input properties are implicitly available as output properties. Additionally, the SSHKey resource produces the following output properties:
- Date
Created string - The date the SSH key was added to your Vultr account.
- Id string
- The provider-assigned unique ID for this managed resource.
- Date
Created string - The date the SSH key was added to your Vultr account.
- Id string
- The provider-assigned unique ID for this managed resource.
- date
Created String - The date the SSH key was added to your Vultr account.
- id String
- The provider-assigned unique ID for this managed resource.
- date
Created string - The date the SSH key was added to your Vultr account.
- id string
- The provider-assigned unique ID for this managed resource.
- date_
created str - The date the SSH key was added to your Vultr account.
- id str
- The provider-assigned unique ID for this managed resource.
- date
Created String - The date the SSH key was added to your Vultr account.
- 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,
date_created: Optional[str] = None,
name: Optional[str] = None,
ssh_key: Optional[str] = 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)
Resource lookup is not supported in YAML
- 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.
- Date
Created string - The date the SSH key was added to your Vultr account.
- Name string
- The name/label of the SSH key.
- Ssh
Key string - The public SSH key.
- Date
Created string - The date the SSH key was added to your Vultr account.
- Name string
- The name/label of the SSH key.
- Ssh
Key string - The public SSH key.
- date
Created String - The date the SSH key was added to your Vultr account.
- name String
- The name/label of the SSH key.
- ssh
Key String - The public SSH key.
- date
Created string - The date the SSH key was added to your Vultr account.
- name string
- The name/label of the SSH key.
- ssh
Key string - The public SSH key.
- date_
created str - The date the SSH key was added to your Vultr account.
- name str
- The name/label of the SSH key.
- ssh_
key str - The public SSH key.
- date
Created String - The date the SSH key was added to your Vultr account.
- name String
- The name/label of the SSH key.
- ssh
Key String - The public SSH key.
Import
SSH keys can be imported using the SSH key ID
, e.g.
$ pulumi import vultr:index/sSHKey:SSHKey my_key 6b0876a7-f709-41ba-aed8-abed9d38ae45
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.