1. Packages
  2. Ibm Provider
  3. API Docs
  4. getPiKey
ibm 1.81.1 published on Wednesday, Aug 6, 2025 by ibm-cloud

ibm.getPiKey

Explore with Pulumi AI

ibm logo
ibm 1.81.1 published on Wednesday, Aug 6, 2025 by ibm-cloud

    Retrieve information about the SSH key that is used for your Power Systems Virtual Server instance. The SSH key is used to access the instance after it is created. For more information, about generating and using SSH Keys.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const dsInstance = ibm.getPiKey({
        piCloudInstanceId: "49fba6c9-23f8-40bc-9899-aca322ee7d5b",
        piKeyName: "terraform-test-key",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    ds_instance = ibm.get_pi_key(pi_cloud_instance_id="49fba6c9-23f8-40bc-9899-aca322ee7d5b",
        pi_key_name="terraform-test-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.LookupPiKey(ctx, &ibm.LookupPiKeyArgs{
    			PiCloudInstanceId: "49fba6c9-23f8-40bc-9899-aca322ee7d5b",
    			PiKeyName:         "terraform-test-key",
    		}, nil)
    		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 dsInstance = Ibm.GetPiKey.Invoke(new()
        {
            PiCloudInstanceId = "49fba6c9-23f8-40bc-9899-aca322ee7d5b",
            PiKeyName = "terraform-test-key",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetPiKeyArgs;
    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) {
            final var dsInstance = IbmFunctions.getPiKey(GetPiKeyArgs.builder()
                .piCloudInstanceId("49fba6c9-23f8-40bc-9899-aca322ee7d5b")
                .piKeyName("terraform-test-key")
                .build());
    
        }
    }
    
    variables:
      dsInstance:
        fn::invoke:
          function: ibm:getPiKey
          arguments:
            piCloudInstanceId: 49fba6c9-23f8-40bc-9899-aca322ee7d5b
            piKeyName: terraform-test-key
    

    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) {
        }
    }
    
    {}
    

    Using getPiKey

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getPiKey(args: GetPiKeyArgs, opts?: InvokeOptions): Promise<GetPiKeyResult>
    function getPiKeyOutput(args: GetPiKeyOutputArgs, opts?: InvokeOptions): Output<GetPiKeyResult>
    def get_pi_key(id: Optional[str] = None,
                   pi_cloud_instance_id: Optional[str] = None,
                   pi_key_name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetPiKeyResult
    def get_pi_key_output(id: Optional[pulumi.Input[str]] = None,
                   pi_cloud_instance_id: Optional[pulumi.Input[str]] = None,
                   pi_key_name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetPiKeyResult]
    func LookupPiKey(ctx *Context, args *LookupPiKeyArgs, opts ...InvokeOption) (*LookupPiKeyResult, error)
    func LookupPiKeyOutput(ctx *Context, args *LookupPiKeyOutputArgs, opts ...InvokeOption) LookupPiKeyResultOutput

    > Note: This function is named LookupPiKey in the Go SDK.

    public static class GetPiKey 
    {
        public static Task<GetPiKeyResult> InvokeAsync(GetPiKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetPiKeyResult> Invoke(GetPiKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPiKeyResult> getPiKey(GetPiKeyArgs args, InvokeOptions options)
    public static Output<GetPiKeyResult> getPiKey(GetPiKeyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getPiKey:getPiKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiKeyName string
    User defined name for the SSH key or SSH key ID.
    Id string
    (String) User defined name for the SSH key
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiKeyName string
    User defined name for the SSH key or SSH key ID.
    Id string
    (String) User defined name for the SSH key
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piKeyName String
    User defined name for the SSH key or SSH key ID.
    id String
    (String) User defined name for the SSH key
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piKeyName string
    User defined name for the SSH key or SSH key ID.
    id string
    (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_name str
    User defined name for the SSH key or SSH key ID.
    id str
    (String) User defined name for the SSH key
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piKeyName String
    User defined name for the SSH key or SSH key ID.
    id String
    (String) User defined name for the SSH key

    getPiKey Result

    The following output properties are available:

    CreationDate string
    (String) Date of SSH Key creation.
    Description string
    (String) Description of the SSH key.
    Id string
    (String) User defined name for the SSH key
    Name string
    (String) Name of SSH key.
    PiCloudInstanceId string
    PiKeyName string
    PrimaryWorkspace bool
    (Boolean) Indicates if the current workspace owns the ssh key or not.
    SshKey string
    (String) SSH RSA key.
    SshKeyId string
    (String) Unique ID of SSH key.
    Visibility string
    (String) Visibility of the SSH key.
    CreationDate string
    (String) Date of SSH Key creation.
    Description string
    (String) Description of the SSH key.
    Id string
    (String) User defined name for the SSH key
    Name string
    (String) Name of SSH key.
    PiCloudInstanceId string
    PiKeyName string
    PrimaryWorkspace bool
    (Boolean) Indicates if the current workspace owns the ssh key or not.
    SshKey string
    (String) SSH RSA key.
    SshKeyId string
    (String) Unique ID of SSH key.
    Visibility string
    (String) Visibility of the SSH key.
    creationDate String
    (String) Date of SSH Key creation.
    description String
    (String) Description of the SSH key.
    id String
    (String) User defined name for the SSH key
    name String
    (String) Name of SSH key.
    piCloudInstanceId String
    piKeyName String
    primaryWorkspace Boolean
    (Boolean) Indicates if the current workspace owns the ssh key or not.
    sshKey String
    (String) SSH RSA key.
    sshKeyId String
    (String) Unique ID of SSH key.
    visibility String
    (String) Visibility of the SSH key.
    creationDate string
    (String) Date of SSH Key creation.
    description string
    (String) Description of the SSH key.
    id string
    (String) User defined name for the SSH key
    name string
    (String) Name of SSH key.
    piCloudInstanceId string
    piKeyName string
    primaryWorkspace boolean
    (Boolean) Indicates if the current workspace owns the ssh key or not.
    sshKey string
    (String) SSH RSA key.
    sshKeyId string
    (String) Unique ID of SSH key.
    visibility string
    (String) Visibility of the SSH key.
    creation_date str
    (String) Date of SSH Key creation.
    description str
    (String) Description of the SSH key.
    id str
    (String) User defined name for the SSH key
    name str
    (String) Name of SSH key.
    pi_cloud_instance_id str
    pi_key_name str
    primary_workspace bool
    (Boolean) Indicates if the current workspace owns the ssh key or not.
    ssh_key str
    (String) SSH RSA key.
    ssh_key_id str
    (String) Unique ID of SSH key.
    visibility str
    (String) Visibility of the SSH key.
    creationDate String
    (String) Date of SSH Key creation.
    description String
    (String) Description of the SSH key.
    id String
    (String) User defined name for the SSH key
    name String
    (String) Name of SSH key.
    piCloudInstanceId String
    piKeyName String
    primaryWorkspace Boolean
    (Boolean) Indicates if the current workspace owns the ssh key or not.
    sshKey String
    (String) SSH RSA key.
    sshKeyId String
    (String) Unique ID of SSH key.
    visibility String
    (String) Visibility of the SSH key.

    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.81.1 published on Wednesday, Aug 6, 2025 by ibm-cloud