1. Packages
  2. Ibm Provider
  3. API Docs
  4. ComputeSshKey
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.ComputeSshKey

Explore with Pulumi AI

Create, update, and delete an SSH key resource. For more information, about computer SSH key, see deploying server pools and origins in a single MZR.

Note

For more information, see the IBM Cloud Classic Infrastructure (SoftLayer) API docs.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";

const testSshKey = new ibm.ComputeSshKey("testSshKey", {
    label: "test_ssh_key_name",
    notes: "test_ssh_key_notes",
    publicKey: "ssh-rsa <rsa_public_key>",
});
Copy
import pulumi
import pulumi_ibm as ibm

test_ssh_key = ibm.ComputeSshKey("testSshKey",
    label="test_ssh_key_name",
    notes="test_ssh_key_notes",
    public_key="ssh-rsa <rsa_public_key>")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ibm.NewComputeSshKey(ctx, "testSshKey", &ibm.ComputeSshKeyArgs{
			Label:     pulumi.String("test_ssh_key_name"),
			Notes:     pulumi.String("test_ssh_key_notes"),
			PublicKey: pulumi.String("ssh-rsa <rsa_public_key>"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;

return await Deployment.RunAsync(() => 
{
    var testSshKey = new Ibm.ComputeSshKey("testSshKey", new()
    {
        Label = "test_ssh_key_name",
        Notes = "test_ssh_key_notes",
        PublicKey = "ssh-rsa <rsa_public_key>",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.ComputeSshKey;
import com.pulumi.ibm.ComputeSshKeyArgs;
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 testSshKey = new ComputeSshKey("testSshKey", ComputeSshKeyArgs.builder()
            .label("test_ssh_key_name")
            .notes("test_ssh_key_notes")
            .publicKey("ssh-rsa <rsa_public_key>")
            .build());

    }
}
Copy
resources:
  testSshKey:
    type: ibm:ComputeSshKey
    properties:
      label: test_ssh_key_name
      notes: test_ssh_key_notes
      publicKey: ssh-rsa <rsa_public_key>
Copy

Create ComputeSshKey Resource

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

Constructor syntax

new ComputeSshKey(name: string, args: ComputeSshKeyArgs, opts?: CustomResourceOptions);
@overload
def ComputeSshKey(resource_name: str,
                  args: ComputeSshKeyArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def ComputeSshKey(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  label: Optional[str] = None,
                  public_key: Optional[str] = None,
                  compute_ssh_key_id: Optional[str] = None,
                  notes: Optional[str] = None,
                  tags: Optional[Sequence[str]] = None)
func NewComputeSshKey(ctx *Context, name string, args ComputeSshKeyArgs, opts ...ResourceOption) (*ComputeSshKey, error)
public ComputeSshKey(string name, ComputeSshKeyArgs args, CustomResourceOptions? opts = null)
public ComputeSshKey(String name, ComputeSshKeyArgs args)
public ComputeSshKey(String name, ComputeSshKeyArgs args, CustomResourceOptions options)
type: ibm:ComputeSshKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ComputeSshKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ComputeSshKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ComputeSshKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ComputeSshKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ComputeSshKeyArgs
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 computeSshKeyResource = new Ibm.ComputeSshKey("computeSshKeyResource", new()
{
    Label = "string",
    PublicKey = "string",
    ComputeSshKeyId = "string",
    Notes = "string",
    Tags = new[]
    {
        "string",
    },
});
Copy
example, err := ibm.NewComputeSshKey(ctx, "computeSshKeyResource", &ibm.ComputeSshKeyArgs{
	Label:           pulumi.String("string"),
	PublicKey:       pulumi.String("string"),
	ComputeSshKeyId: pulumi.String("string"),
	Notes:           pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var computeSshKeyResource = new ComputeSshKey("computeSshKeyResource", ComputeSshKeyArgs.builder()
    .label("string")
    .publicKey("string")
    .computeSshKeyId("string")
    .notes("string")
    .tags("string")
    .build());
Copy
compute_ssh_key_resource = ibm.ComputeSshKey("computeSshKeyResource",
    label="string",
    public_key="string",
    compute_ssh_key_id="string",
    notes="string",
    tags=["string"])
Copy
const computeSshKeyResource = new ibm.ComputeSshKey("computeSshKeyResource", {
    label: "string",
    publicKey: "string",
    computeSshKeyId: "string",
    notes: "string",
    tags: ["string"],
});
Copy
type: ibm:ComputeSshKey
properties:
    computeSshKeyId: string
    label: string
    notes: string
    publicKey: string
    tags:
        - string
Copy

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

Label This property is required. string
The descriptive name that is used to identify an SSH key.
PublicKey This property is required. string
The public SSH key.
ComputeSshKeyId string
(String )The unique identifier of the new SSH key.
Notes string
Descriptive text about the SSH key.
Tags List<string>
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
Label This property is required. string
The descriptive name that is used to identify an SSH key.
PublicKey This property is required. string
The public SSH key.
ComputeSshKeyId string
(String )The unique identifier of the new SSH key.
Notes string
Descriptive text about the SSH key.
Tags []string
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
label This property is required. String
The descriptive name that is used to identify an SSH key.
publicKey This property is required. String
The public SSH key.
computeSshKeyId String
(String )The unique identifier of the new SSH key.
notes String
Descriptive text about the SSH key.
tags List<String>
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
label This property is required. string
The descriptive name that is used to identify an SSH key.
publicKey This property is required. string
The public SSH key.
computeSshKeyId string
(String )The unique identifier of the new SSH key.
notes string
Descriptive text about the SSH key.
tags string[]
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
label This property is required. str
The descriptive name that is used to identify an SSH key.
public_key This property is required. str
The public SSH key.
compute_ssh_key_id str
(String )The unique identifier of the new SSH key.
notes str
Descriptive text about the SSH key.
tags Sequence[str]
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
label This property is required. String
The descriptive name that is used to identify an SSH key.
publicKey This property is required. String
The public SSH key.
computeSshKeyId String
(String )The unique identifier of the new SSH key.
notes String
Descriptive text about the SSH key.
tags List<String>
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.

Outputs

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

Fingerprint string
(String) The sequence of bytes to authenticate or look up a longer SSH key.
Id string
The provider-assigned unique ID for this managed resource.
Fingerprint string
(String) The sequence of bytes to authenticate or look up a longer SSH key.
Id string
The provider-assigned unique ID for this managed resource.
fingerprint String
(String) The sequence of bytes to authenticate or look up a longer SSH key.
id String
The provider-assigned unique ID for this managed resource.
fingerprint string
(String) The sequence of bytes to authenticate or look up a longer SSH key.
id string
The provider-assigned unique ID for this managed resource.
fingerprint str
(String) The sequence of bytes to authenticate or look up a longer SSH key.
id str
The provider-assigned unique ID for this managed resource.
fingerprint String
(String) The sequence of bytes to authenticate or look up a longer SSH key.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ComputeSshKey Resource

Get an existing ComputeSshKey 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?: ComputeSshKeyState, opts?: CustomResourceOptions): ComputeSshKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compute_ssh_key_id: Optional[str] = None,
        fingerprint: Optional[str] = None,
        label: Optional[str] = None,
        notes: Optional[str] = None,
        public_key: Optional[str] = None,
        tags: Optional[Sequence[str]] = None) -> ComputeSshKey
func GetComputeSshKey(ctx *Context, name string, id IDInput, state *ComputeSshKeyState, opts ...ResourceOption) (*ComputeSshKey, error)
public static ComputeSshKey Get(string name, Input<string> id, ComputeSshKeyState? state, CustomResourceOptions? opts = null)
public static ComputeSshKey get(String name, Output<String> id, ComputeSshKeyState state, CustomResourceOptions options)
resources:  _:    type: ibm:ComputeSshKey    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ComputeSshKeyId string
(String )The unique identifier of the new SSH key.
Fingerprint string
(String) The sequence of bytes to authenticate or look up a longer SSH key.
Label string
The descriptive name that is used to identify an SSH key.
Notes string
Descriptive text about the SSH key.
PublicKey string
The public SSH key.
Tags List<string>
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
ComputeSshKeyId string
(String )The unique identifier of the new SSH key.
Fingerprint string
(String) The sequence of bytes to authenticate or look up a longer SSH key.
Label string
The descriptive name that is used to identify an SSH key.
Notes string
Descriptive text about the SSH key.
PublicKey string
The public SSH key.
Tags []string
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
computeSshKeyId String
(String )The unique identifier of the new SSH key.
fingerprint String
(String) The sequence of bytes to authenticate or look up a longer SSH key.
label String
The descriptive name that is used to identify an SSH key.
notes String
Descriptive text about the SSH key.
publicKey String
The public SSH key.
tags List<String>
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
computeSshKeyId string
(String )The unique identifier of the new SSH key.
fingerprint string
(String) The sequence of bytes to authenticate or look up a longer SSH key.
label string
The descriptive name that is used to identify an SSH key.
notes string
Descriptive text about the SSH key.
publicKey string
The public SSH key.
tags string[]
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
compute_ssh_key_id str
(String )The unique identifier of the new SSH key.
fingerprint str
(String) The sequence of bytes to authenticate or look up a longer SSH key.
label str
The descriptive name that is used to identify an SSH key.
notes str
Descriptive text about the SSH key.
public_key str
The public SSH key.
tags Sequence[str]
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
computeSshKeyId String
(String )The unique identifier of the new SSH key.
fingerprint String
(String) The sequence of bytes to authenticate or look up a longer SSH key.
label String
The descriptive name that is used to identify an SSH key.
notes String
Descriptive text about the SSH key.
publicKey String
The public SSH key.
tags List<String>
Tags associated with the SSH Key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.

Package Details

Repository
ibm ibm-cloud/terraform-provider-ibm
License
Notes
This Pulumi package is based on the ibm Terraform Provider.