1. Packages
  2. Ibm Provider
  3. API Docs
  4. PiKey
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.PiKey

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, or delete an SSH key for your Power Systems Virtual Server instance. The SSH key is used to access the instance after it is created. For more information, about SSH keys in Power Virtual Server, see getting started with IBM Power Systems Virtual Servers.

    Example Usage

    The following example enables you to create a SSH key to be used during creation of a power virtual server instance:

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const testaccSshkey = new ibm.PiKey("testaccSshkey", {
        piCloudInstanceId: "<value of the cloud_instance_id>",
        piKeyName: "testkey",
        piSshKey: "ssh-rsa <value>",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    testacc_sshkey = ibm.PiKey("testaccSshkey",
        pi_cloud_instance_id="<value of the cloud_instance_id>",
        pi_key_name="testkey",
        pi_ssh_key="ssh-rsa <value>")
    
    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.NewPiKey(ctx, "testaccSshkey", &ibm.PiKeyArgs{
    			PiCloudInstanceId: pulumi.String("<value of the cloud_instance_id>"),
    			PiKeyName:         pulumi.String("testkey"),
    			PiSshKey:          pulumi.String("ssh-rsa <value>"),
    		})
    		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 testaccSshkey = new Ibm.PiKey("testaccSshkey", new()
        {
            PiCloudInstanceId = "<value of the cloud_instance_id>",
            PiKeyName = "testkey",
            PiSshKey = "ssh-rsa <value>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.PiKey;
    import com.pulumi.ibm.PiKeyArgs;
    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 testaccSshkey = new PiKey("testaccSshkey", PiKeyArgs.builder()
                .piCloudInstanceId("<value of the cloud_instance_id>")
                .piKeyName("testkey")
                .piSshKey("ssh-rsa <value>")
                .build());
    
        }
    }
    
    resources:
      testaccSshkey:
        type: ibm:PiKey
        properties:
          piCloudInstanceId: <value of the cloud_instance_id>
          piKeyName: testkey
          piSshKey: ssh-rsa <value>
    

    Notes

    • Please find supported Regions for endpoints.
    • If a Power cloud instance is provisioned at lon04, The provider level attributes should be as follows:
      • region - lon
      • zone - lon04

    Example usage:

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    Create PiKey Resource

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

    Constructor syntax

    new PiKey(name: string, args: PiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def PiKey(resource_name: str,
              args: PiKeyArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def PiKey(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              pi_cloud_instance_id: Optional[str] = None,
              pi_key_name: Optional[str] = None,
              pi_ssh_key: Optional[str] = None,
              pi_key_id: Optional[str] = None,
              timeouts: Optional[PiKeyTimeoutsArgs] = None)
    func NewPiKey(ctx *Context, name string, args PiKeyArgs, opts ...ResourceOption) (*PiKey, error)
    public PiKey(string name, PiKeyArgs args, CustomResourceOptions? opts = null)
    public PiKey(String name, PiKeyArgs args)
    public PiKey(String name, PiKeyArgs args, CustomResourceOptions options)
    
    type: ibm:PiKey
    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 PiKeyArgs
    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 PiKeyArgs
    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 PiKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PiKeyArgs
    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 piKeyResource = new Ibm.PiKey("piKeyResource", new()
    {
        PiCloudInstanceId = "string",
        PiKeyName = "string",
        PiSshKey = "string",
        PiKeyId = "string",
        Timeouts = new Ibm.Inputs.PiKeyTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
    });
    
    example, err := ibm.NewPiKey(ctx, "piKeyResource", &ibm.PiKeyArgs{
    	PiCloudInstanceId: pulumi.String("string"),
    	PiKeyName:         pulumi.String("string"),
    	PiSshKey:          pulumi.String("string"),
    	PiKeyId:           pulumi.String("string"),
    	Timeouts: &ibm.PiKeyTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    })
    
    var piKeyResource = new PiKey("piKeyResource", PiKeyArgs.builder()
        .piCloudInstanceId("string")
        .piKeyName("string")
        .piSshKey("string")
        .piKeyId("string")
        .timeouts(PiKeyTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .build());
    
    pi_key_resource = ibm.PiKey("piKeyResource",
        pi_cloud_instance_id="string",
        pi_key_name="string",
        pi_ssh_key="string",
        pi_key_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
        })
    
    const piKeyResource = new ibm.PiKey("piKeyResource", {
        piCloudInstanceId: "string",
        piKeyName: "string",
        piSshKey: "string",
        piKeyId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
    });
    
    type: ibm:PiKey
    properties:
        piCloudInstanceId: string
        piKeyId: string
        piKeyName: string
        piSshKey: string
        timeouts:
            create: string
            delete: string
    

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

    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiKeyName string
    User defined name for the SSH key.
    PiSshKey string
    SSH RSA key.
    PiKeyId string
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    Timeouts PiKeyTimeouts
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiKeyName string
    User defined name for the SSH key.
    PiSshKey string
    SSH RSA key.
    PiKeyId string
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    Timeouts PiKeyTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piKeyName String
    User defined name for the SSH key.
    piSshKey String
    SSH RSA key.
    piKeyId String
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    timeouts PiKeyTimeouts
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piKeyName string
    User defined name for the SSH key.
    piSshKey string
    SSH RSA key.
    piKeyId string
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    timeouts PiKeyTimeouts
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_key_name str
    User defined name for the SSH key.
    pi_ssh_key str
    SSH RSA key.
    pi_key_id str
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    timeouts PiKeyTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piKeyName String
    User defined name for the SSH key.
    piSshKey String
    SSH RSA key.
    piKeyId String
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    timeouts Property Map

    Outputs

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

    CreationDate string
    (String) Date of SSH Key creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    SSH RSA key.
    Name string
    (String) User defined name for the SSH key.
    CreationDate string
    (String) Date of SSH Key creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    SSH RSA key.
    Name string
    (String) User defined name for the SSH key.
    creationDate String
    (String) Date of SSH Key creation.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    SSH RSA key.
    name String
    (String) User defined name for the SSH key.
    creationDate string
    (String) Date of SSH Key creation.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    SSH RSA key.
    name string
    (String) User defined name for the SSH key.
    creation_date str
    (String) Date of SSH Key creation.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    SSH RSA key.
    name str
    (String) User defined name for the SSH key.
    creationDate String
    (String) Date of SSH Key creation.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    SSH RSA key.
    name String
    (String) User defined name for the SSH key.

    Look up Existing PiKey Resource

    Get an existing PiKey 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?: PiKeyState, opts?: CustomResourceOptions): PiKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            creation_date: Optional[str] = None,
            key: Optional[str] = None,
            name: Optional[str] = None,
            pi_cloud_instance_id: Optional[str] = None,
            pi_key_id: Optional[str] = None,
            pi_key_name: Optional[str] = None,
            pi_ssh_key: Optional[str] = None,
            timeouts: Optional[PiKeyTimeoutsArgs] = None) -> PiKey
    func GetPiKey(ctx *Context, name string, id IDInput, state *PiKeyState, opts ...ResourceOption) (*PiKey, error)
    public static PiKey Get(string name, Input<string> id, PiKeyState? state, CustomResourceOptions? opts = null)
    public static PiKey get(String name, Output<String> id, PiKeyState state, CustomResourceOptions options)
    resources:  _:    type: ibm:PiKey    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.
    The following state arguments are supported:
    CreationDate string
    (String) Date of SSH Key creation.
    Key string
    SSH RSA key.
    Name string
    (String) User defined name for the SSH key.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiKeyId string
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    PiKeyName string
    User defined name for the SSH key.
    PiSshKey string
    SSH RSA key.
    Timeouts PiKeyTimeouts
    CreationDate string
    (String) Date of SSH Key creation.
    Key string
    SSH RSA key.
    Name string
    (String) User defined name for the SSH key.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiKeyId string
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    PiKeyName string
    User defined name for the SSH key.
    PiSshKey string
    SSH RSA key.
    Timeouts PiKeyTimeoutsArgs
    creationDate String
    (String) Date of SSH Key creation.
    key String
    SSH RSA key.
    name String
    (String) User defined name for the SSH key.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piKeyId String
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    piKeyName String
    User defined name for the SSH key.
    piSshKey String
    SSH RSA key.
    timeouts PiKeyTimeouts
    creationDate string
    (String) Date of SSH Key creation.
    key string
    SSH RSA key.
    name string
    (String) User defined name for the SSH key.
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piKeyId string
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    piKeyName string
    User defined name for the SSH key.
    piSshKey string
    SSH RSA key.
    timeouts PiKeyTimeouts
    creation_date str
    (String) Date of SSH Key creation.
    key str
    SSH RSA key.
    name str
    (String) User defined name for the SSH key.
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_key_id str
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    pi_key_name str
    User defined name for the SSH key.
    pi_ssh_key str
    SSH RSA key.
    timeouts PiKeyTimeoutsArgs
    creationDate String
    (String) Date of SSH Key creation.
    key String
    SSH RSA key.
    name String
    (String) User defined name for the SSH key.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piKeyId String
    (String) The unique identifier of the key. The ID is composed of <pi_cloud_instance_id>/<pi_key_name>.
    piKeyName String
    User defined name for the SSH key.
    piSshKey String
    SSH RSA key.
    timeouts Property Map

    Supporting Types

    PiKeyTimeouts, PiKeyTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

    Example

    bash

    $ pulumi import ibm:index/piKey:PiKey example d7bec597-4726-451f-8a63-e62e6f19c32c/mykey
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud