published on Friday, Jul 17, 2026 by OVHcloud
published on Friday, Jul 17, 2026 by OVHcloud
This resource uses a Beta API. Creates an SSH key in a Public Cloud project.
SSH keys are immutable — both
nameandpublic_keyforce resource replacement if changed.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
const myKey = new ovh.CloudSSHKey("my_key", {
serviceName: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
name: "my-deploy-key",
publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@host",
});
import pulumi
import pulumi_ovh as ovh
my_key = ovh.CloudSSHKey("my_key",
service_name="aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
name="my-deploy-key",
public_key="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@host")
package main
import (
"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ovh.NewCloudSSHKey(ctx, "my_key", &ovh.CloudSSHKeyArgs{
ServiceName: pulumi.String("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
Name: pulumi.String("my-deploy-key"),
PublicKey: pulumi.String("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@host"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var myKey = new Ovh.CloudSSHKey("my_key", new()
{
ServiceName = "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
Name = "my-deploy-key",
PublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@host",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.ovhcloud.pulumi.ovh.CloudSSHKey;
import com.ovhcloud.pulumi.ovh.CloudSSHKeyArgs;
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 myKey = new CloudSSHKey("myKey", CloudSSHKeyArgs.builder()
.serviceName("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
.name("my-deploy-key")
.publicKey("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@host")
.build());
}
}
resources:
myKey:
type: ovh:CloudSSHKey
name: my_key
properties:
serviceName: aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
name: my-deploy-key
publicKey: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@host
Example coming soon!
Create ClousSSHKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ClousSSHKey(name: string, args: ClousSSHKeyArgs, opts?: CustomResourceOptions);@overload
def ClousSSHKey(resource_name: str,
args: ClousSSHKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ClousSSHKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
public_key: Optional[str] = None,
service_name: Optional[str] = None)func NewClousSSHKey(ctx *Context, name string, args ClousSSHKeyArgs, opts ...ResourceOption) (*ClousSSHKey, error)public ClousSSHKey(string name, ClousSSHKeyArgs args, CustomResourceOptions? opts = null)
public ClousSSHKey(String name, ClousSSHKeyArgs args)
public ClousSSHKey(String name, ClousSSHKeyArgs args, CustomResourceOptions options)
type: ovh:ClousSSHKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "ovh_clous_s_s_h_key" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ClousSSHKeyArgs
- 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 ClousSSHKeyArgs
- 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 ClousSSHKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClousSSHKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ClousSSHKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ClousSSHKey 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 ClousSSHKey resource accepts the following input properties:
- Public
Key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - Name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource.
- Public
Key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - Name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource.
- public_
key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- service_
name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource.
- public
Key String - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - name String
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource.
- public
Key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource.
- public_
key str - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - name str
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- service_
name str - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource.
- public
Key String - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - name String
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ClousSSHKey resource produces the following output properties:
- created_
at string - Creation date of the SSH key (RFC 3339 format).
- id string
- The provider-assigned unique ID for this managed resource.
- updated_
at string - Last update date of the SSH key (RFC 3339 format).
- created_
at str - Creation date of the SSH key (RFC 3339 format).
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
at str - Last update date of the SSH key (RFC 3339 format).
Look up Existing ClousSSHKey Resource
Get an existing ClousSSHKey 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?: ClousSSHKeyState, opts?: CustomResourceOptions): ClousSSHKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
name: Optional[str] = None,
public_key: Optional[str] = None,
service_name: Optional[str] = None,
updated_at: Optional[str] = None) -> ClousSSHKeyfunc GetClousSSHKey(ctx *Context, name string, id IDInput, state *ClousSSHKeyState, opts ...ResourceOption) (*ClousSSHKey, error)public static ClousSSHKey Get(string name, Input<string> id, ClousSSHKeyState? state, CustomResourceOptions? opts = null)public static ClousSSHKey get(String name, Output<String> id, ClousSSHKeyState state, CustomResourceOptions options)resources: _: type: ovh:ClousSSHKey get: id: ${id}import {
to = ovh_clous_s_s_h_key.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.
- Created
At string - Creation date of the SSH key (RFC 3339 format).
- Name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- Public
Key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource. - Updated
At string - Last update date of the SSH key (RFC 3339 format).
- Created
At string - Creation date of the SSH key (RFC 3339 format).
- Name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- Public
Key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource. - Updated
At string - Last update date of the SSH key (RFC 3339 format).
- created_
at string - Creation date of the SSH key (RFC 3339 format).
- name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- public_
key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - service_
name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource. - updated_
at string - Last update date of the SSH key (RFC 3339 format).
- created
At String - Creation date of the SSH key (RFC 3339 format).
- name String
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- public
Key String - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource. - updated
At String - Last update date of the SSH key (RFC 3339 format).
- created
At string - Creation date of the SSH key (RFC 3339 format).
- name string
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- public
Key string - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource. - updated
At string - Last update date of the SSH key (RFC 3339 format).
- created_
at str - Creation date of the SSH key (RFC 3339 format).
- name str
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- public_
key str - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - service_
name str - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource. - updated_
at str - Last update date of the SSH key (RFC 3339 format).
- created
At String - Creation date of the SSH key (RFC 3339 format).
- name String
- SSH key name. Must be unique within the project. Used as the resource identifier. Changing this value recreates the resource.
- public
Key String - SSH public key content (e.g. the contents of
~/.ssh/id_ed25519.pub). Changing this value recreates the resource. - service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. Changing this value recreates the resource. - updated
At String - Last update date of the SSH key (RFC 3339 format).
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovhTerraform Provider.
published on Friday, Jul 17, 2026 by OVHcloud