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>",
});
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>")
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
})
}
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>",
});
});
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());
}
}
resources:
testSshKey:
type: ibm:ComputeSshKey
properties:
label: test_ssh_key_name
notes: test_ssh_key_notes
publicKey: ssh-rsa <rsa_public_key>
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 string
- The unique name of the resource.
- args ComputeSshKeyArgs
- 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 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 string
- The unique name of the resource.
- args ComputeSshKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComputeSshKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
},
});
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"),
},
})
var computeSshKeyResource = new ComputeSshKey("computeSshKeyResource", ComputeSshKeyArgs.builder()
.label("string")
.publicKey("string")
.computeSshKeyId("string")
.notes("string")
.tags("string")
.build());
compute_ssh_key_resource = ibm.ComputeSshKey("computeSshKeyResource",
label="string",
public_key="string",
compute_ssh_key_id="string",
notes="string",
tags=["string"])
const computeSshKeyResource = new ibm.ComputeSshKey("computeSshKeyResource", {
label: "string",
publicKey: "string",
computeSshKeyId: "string",
notes: "string",
tags: ["string"],
});
type: ibm:ComputeSshKey
properties:
computeSshKeyId: string
label: string
notes: string
publicKey: string
tags:
- string
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 string
- The descriptive name that is used to identify an SSH key.
- Public
Key string - The public SSH key.
- Compute
Ssh stringKey Id - (String )The unique identifier of the new SSH key.
- Notes string
- Descriptive text about the SSH key.
- 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 string
- The descriptive name that is used to identify an SSH key.
- Public
Key string - The public SSH key.
- Compute
Ssh stringKey Id - (String )The unique identifier of the new SSH key.
- Notes string
- Descriptive text about the SSH key.
- []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 String
- The descriptive name that is used to identify an SSH key.
- public
Key String - The public SSH key.
- compute
Ssh StringKey Id - (String )The unique identifier of the new SSH key.
- notes String
- Descriptive text about the SSH key.
- 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 string
- The descriptive name that is used to identify an SSH key.
- public
Key string - The public SSH key.
- compute
Ssh stringKey Id - (String )The unique identifier of the new SSH key.
- notes string
- Descriptive text about the SSH key.
- 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 str
- The descriptive name that is used to identify an SSH key.
- public_
key str - The public SSH key.
- compute_
ssh_ strkey_ id - (String )The unique identifier of the new SSH key.
- notes str
- Descriptive text about the SSH key.
- 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 String
- The descriptive name that is used to identify an SSH key.
- public
Key String - The public SSH key.
- compute
Ssh StringKey Id - (String )The unique identifier of the new SSH key.
- notes String
- Descriptive text about the SSH key.
- 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
- 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.
- Compute
Ssh stringKey Id - (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.
- Public
Key string - The public SSH key.
- 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.
- Compute
Ssh stringKey Id - (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.
- Public
Key string - The public SSH key.
- []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 StringKey Id - (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.
- public
Key String - The public SSH key.
- 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.
- compute
Ssh stringKey Id - (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.
- public
Key string - The public SSH key.
- 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_ strkey_ id - (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.
- 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.
- compute
Ssh StringKey Id - (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.
- public
Key String - The public SSH key.
- 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.