published on Monday, Mar 30, 2026 by g-core
published on Monday, Mar 30, 2026 by g-core
SSH key pairs provide secure authentication to cloud instances, supporting both generated and imported public keys.
Example Usage
Upload an existing SSH key
Add an SSH public key that can be used when creating instances.
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
// Upload an existing SSH public key
const deployer = new gcore.CloudSshKey("deployer", {
projectId: 1,
name: "deployer-key",
publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJe8rDJP... deployer@workstation",
});
import pulumi
import pulumi_gcore as gcore
# Upload an existing SSH public key
deployer = gcore.CloudSshKey("deployer",
project_id=1,
name="deployer-key",
public_key="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJe8rDJP... deployer@workstation")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/v2/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Upload an existing SSH public key
_, err := gcore.NewCloudSshKey(ctx, "deployer", &gcore.CloudSshKeyArgs{
ProjectId: pulumi.Float64(1),
Name: pulumi.String("deployer-key"),
PublicKey: pulumi.String("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJe8rDJP... deployer@workstation"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
// Upload an existing SSH public key
var deployer = new Gcore.CloudSshKey("deployer", new()
{
ProjectId = 1,
Name = "deployer-key",
PublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJe8rDJP... deployer@workstation",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.CloudSshKey;
import com.pulumi.gcore.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) {
// Upload an existing SSH public key
var deployer = new CloudSshKey("deployer", CloudSshKeyArgs.builder()
.projectId(1.0)
.name("deployer-key")
.publicKey("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJe8rDJP... deployer@workstation")
.build());
}
}
resources:
# Upload an existing SSH public key
deployer:
type: gcore:CloudSshKey
properties:
projectId: 1
name: deployer-key
publicKey: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJe8rDJP... deployer@workstation
Tip: Generate a key pair locally with
ssh-keygen -t ed25519, then paste the contents of the.pubfile intopublic_key.
Create CloudSshKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CloudSshKey(name: string, args: CloudSshKeyArgs, opts?: CustomResourceOptions);@overload
def CloudSshKey(resource_name: str,
args: CloudSshKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CloudSshKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
public_key: Optional[str] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
shared_in_project: Optional[bool] = None)func NewCloudSshKey(ctx *Context, name string, args CloudSshKeyArgs, opts ...ResourceOption) (*CloudSshKey, error)public CloudSshKey(string name, CloudSshKeyArgs args, CustomResourceOptions? opts = null)
public CloudSshKey(String name, CloudSshKeyArgs args)
public CloudSshKey(String name, CloudSshKeyArgs args, CustomResourceOptions options)
type: gcore:CloudSshKey
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 CloudSshKeyArgs
- 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 CloudSshKeyArgs
- 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 CloudSshKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudSshKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CloudSshKeyArgs
- 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 cloudSshKeyResource = new Gcore.Index.CloudSshKey("cloudSshKeyResource", new()
{
PublicKey = "string",
Name = "string",
ProjectId = 0,
SharedInProject = false,
});
example, err := gcore.NewCloudSshKey(ctx, "cloudSshKeyResource", &gcore.CloudSshKeyArgs{
PublicKey: pulumi.String("string"),
Name: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
SharedInProject: pulumi.Bool(false),
})
var cloudSshKeyResource = new CloudSshKey("cloudSshKeyResource", CloudSshKeyArgs.builder()
.publicKey("string")
.name("string")
.projectId(0.0)
.sharedInProject(false)
.build());
cloud_ssh_key_resource = gcore.CloudSshKey("cloudSshKeyResource",
public_key="string",
name="string",
project_id=0,
shared_in_project=False)
const cloudSshKeyResource = new gcore.CloudSshKey("cloudSshKeyResource", {
publicKey: "string",
name: "string",
projectId: 0,
sharedInProject: false,
});
type: gcore:CloudSshKey
properties:
name: string
projectId: 0
publicKey: string
sharedInProject: false
CloudSshKey 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 CloudSshKey resource accepts the following input properties:
- Public
Key string - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - Name string
- SSH key name
- Project
Id double - Project ID
- bool
- SSH key is shared with all users in the project
- Public
Key string - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - Name string
- SSH key name
- Project
Id float64 - Project ID
- bool
- SSH key is shared with all users in the project
- public
Key String - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - name String
- SSH key name
- project
Id Double - Project ID
- Boolean
- SSH key is shared with all users in the project
- public
Key string - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - name string
- SSH key name
- project
Id number - Project ID
- boolean
- SSH key is shared with all users in the project
- public_
key str - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - name str
- SSH key name
- project_
id float - Project ID
- bool
- SSH key is shared with all users in the project
- public
Key String - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - name String
- SSH key name
- project
Id Number - Project ID
- Boolean
- SSH key is shared with all users in the project
Outputs
All input properties are implicitly available as output properties. Additionally, the CloudSshKey resource produces the following output properties:
- Created
At string - SSH key creation time
- Fingerprint string
- Fingerprint
- Id string
- The provider-assigned unique ID for this managed resource.
- State string
- SSH key state Available values: "ACTIVE", "DELETING".
- Created
At string - SSH key creation time
- Fingerprint string
- Fingerprint
- Id string
- The provider-assigned unique ID for this managed resource.
- State string
- SSH key state Available values: "ACTIVE", "DELETING".
- created
At String - SSH key creation time
- fingerprint String
- Fingerprint
- id String
- The provider-assigned unique ID for this managed resource.
- state String
- SSH key state Available values: "ACTIVE", "DELETING".
- created
At string - SSH key creation time
- fingerprint string
- Fingerprint
- id string
- The provider-assigned unique ID for this managed resource.
- state string
- SSH key state Available values: "ACTIVE", "DELETING".
- created_
at str - SSH key creation time
- fingerprint str
- Fingerprint
- id str
- The provider-assigned unique ID for this managed resource.
- state str
- SSH key state Available values: "ACTIVE", "DELETING".
- created
At String - SSH key creation time
- fingerprint String
- Fingerprint
- id String
- The provider-assigned unique ID for this managed resource.
- state String
- SSH key state Available values: "ACTIVE", "DELETING".
Look up Existing CloudSshKey Resource
Get an existing CloudSshKey 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?: CloudSshKeyState, opts?: CustomResourceOptions): CloudSshKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
fingerprint: Optional[str] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
public_key: Optional[str] = None,
shared_in_project: Optional[bool] = None,
state: Optional[str] = None) -> CloudSshKeyfunc GetCloudSshKey(ctx *Context, name string, id IDInput, state *CloudSshKeyState, opts ...ResourceOption) (*CloudSshKey, error)public static CloudSshKey Get(string name, Input<string> id, CloudSshKeyState? state, CustomResourceOptions? opts = null)public static CloudSshKey get(String name, Output<String> id, CloudSshKeyState state, CustomResourceOptions options)resources: _: type: gcore:CloudSshKey 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.
- Created
At string - SSH key creation time
- Fingerprint string
- Fingerprint
- Name string
- SSH key name
- Project
Id double - Project ID
- Public
Key string - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - bool
- SSH key is shared with all users in the project
- State string
- SSH key state Available values: "ACTIVE", "DELETING".
- Created
At string - SSH key creation time
- Fingerprint string
- Fingerprint
- Name string
- SSH key name
- Project
Id float64 - Project ID
- Public
Key string - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - bool
- SSH key is shared with all users in the project
- State string
- SSH key state Available values: "ACTIVE", "DELETING".
- created
At String - SSH key creation time
- fingerprint String
- Fingerprint
- name String
- SSH key name
- project
Id Double - Project ID
- public
Key String - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - Boolean
- SSH key is shared with all users in the project
- state String
- SSH key state Available values: "ACTIVE", "DELETING".
- created
At string - SSH key creation time
- fingerprint string
- Fingerprint
- name string
- SSH key name
- project
Id number - Project ID
- public
Key string - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - boolean
- SSH key is shared with all users in the project
- state string
- SSH key state Available values: "ACTIVE", "DELETING".
- created_
at str - SSH key creation time
- fingerprint str
- Fingerprint
- name str
- SSH key name
- project_
id float - Project ID
- public_
key str - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - bool
- SSH key is shared with all users in the project
- state str
- SSH key state Available values: "ACTIVE", "DELETING".
- created
At String - SSH key creation time
- fingerprint String
- Fingerprint
- name String
- SSH key name
- project
Id Number - Project ID
- public
Key String - The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information. You must provide your own public key (usually found in a file like
id_ed25519.puborid_rsa.pub). Generate your SSH keypair locally usingssh-keygenbefore providing it here. - Boolean
- SSH key is shared with all users in the project
- state String
- SSH key state Available values: "ACTIVE", "DELETING".
Import
$ pulumi import gcore:index/cloudSshKey:CloudSshKey example '<project_id>/<ssh_key_id>'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcoreTerraform Provider.
published on Monday, Mar 30, 2026 by g-core
