The Automation API is now available. No CLI. No human-in-the-loop. Just your code. Learn More

SshKey

Provides a Civo SSH key resource to allow you to manage SSH keys for Instance access. Keys created with this resource can be referenced in your instance configuration via their ID.

Example Usage

using System.IO;
using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var my_user = new Civo.SshKey("my-user", new Civo.SshKeyArgs
        {
            PublicKey = File.ReadAllText("~/.ssh/id_rsa.pub"),
        });
    }

}

Coming soon!

import pulumi
import pulumi_civo as civo

my_user = civo.SshKey("my-user", public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"))
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
import * from "fs";

const my_user = new civo.SshKey("my-user", {publicKey: fs.readFileSync("~/.ssh/id_rsa.pub")});

Create a SshKey Resource

new SshKey(name: string, args: SshKeyArgs, opts?: CustomResourceOptions);
def SshKey(resource_name: str, opts: Optional[ResourceOptions] = None, name: Optional[str] = None, public_key: Optional[str] = None)
func NewSshKey(ctx *Context, name string, args SshKeyArgs, opts ...ResourceOption) (*SshKey, error)
public SshKey(string name, SshKeyArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

SshKey Resource Properties

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

Inputs

The SshKey resource accepts the following input properties:

PublicKey string

The public key. If this is a file, it can be read using the file interpolation function.

Name string

The name of the SSH key for identification

PublicKey string

The public key. If this is a file, it can be read using the file interpolation function.

Name string

The name of the SSH key for identification

publicKey string

The public key. If this is a file, it can be read using the file interpolation function.

name string

The name of the SSH key for identification

public_key str

The public key. If this is a file, it can be read using the file interpolation function.

name str

The name of the SSH key for identification

Outputs

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

Fingerprint string

The fingerprint of the SSH key

Id string
The provider-assigned unique ID for this managed resource.
Fingerprint string

The fingerprint of the SSH key

Id string
The provider-assigned unique ID for this managed resource.
fingerprint string

The fingerprint of the SSH key

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

The fingerprint of the SSH key

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

Look up an 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, fingerprint: Optional[str] = None, name: Optional[str] = None, public_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)
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.

The following state arguments are supported:

Fingerprint string

The fingerprint of the SSH key

Name string

The name of the SSH key for identification

PublicKey string

The public key. If this is a file, it can be read using the file interpolation function.

Fingerprint string

The fingerprint of the SSH key

Name string

The name of the SSH key for identification

PublicKey string

The public key. If this is a file, it can be read using the file interpolation function.

fingerprint string

The fingerprint of the SSH key

name string

The name of the SSH key for identification

publicKey string

The public key. If this is a file, it can be read using the file interpolation function.

fingerprint str

The fingerprint of the SSH key

name str

The name of the SSH key for identification

public_key str

The public key. If this is a file, it can be read using the file interpolation function.

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.