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

ibm.getPiKeys

Explore with Pulumi AI

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

    Retrieve information about all SSH keys. For more information, about generating and using SSH Keys.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const example = ibm.getPiKeys({
        piCloudInstanceId: "<value of the cloud_instance_id>",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    example = ibm.get_pi_keys(pi_cloud_instance_id="<value of the cloud_instance_id>")
    
    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.GetPiKeys(ctx, &ibm.GetPiKeysArgs{
    			PiCloudInstanceId: "<value of the cloud_instance_id>",
    		}, 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 example = Ibm.GetPiKeys.Invoke(new()
        {
            PiCloudInstanceId = "<value of the cloud_instance_id>",
        });
    
    });
    
    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.GetPiKeysArgs;
    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 example = IbmFunctions.getPiKeys(GetPiKeysArgs.builder()
                .piCloudInstanceId("<value of the cloud_instance_id>")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ibm:getPiKeys
          arguments:
            piCloudInstanceId: <value of the cloud_instance_id>
    

    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 getPiKeys

    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 getPiKeys(args: GetPiKeysArgs, opts?: InvokeOptions): Promise<GetPiKeysResult>
    function getPiKeysOutput(args: GetPiKeysOutputArgs, opts?: InvokeOptions): Output<GetPiKeysResult>
    def get_pi_keys(id: Optional[str] = None,
                    pi_cloud_instance_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetPiKeysResult
    def get_pi_keys_output(id: Optional[pulumi.Input[str]] = None,
                    pi_cloud_instance_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetPiKeysResult]
    func GetPiKeys(ctx *Context, args *GetPiKeysArgs, opts ...InvokeOption) (*GetPiKeysResult, error)
    func GetPiKeysOutput(ctx *Context, args *GetPiKeysOutputArgs, opts ...InvokeOption) GetPiKeysResultOutput

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

    public static class GetPiKeys 
    {
        public static Task<GetPiKeysResult> InvokeAsync(GetPiKeysArgs args, InvokeOptions? opts = null)
        public static Output<GetPiKeysResult> Invoke(GetPiKeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPiKeysResult> getPiKeys(GetPiKeysArgs args, InvokeOptions options)
    public static Output<GetPiKeysResult> getPiKeys(GetPiKeysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getPiKeys:getPiKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    Id string
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    Id string
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    id String
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    id string
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    id str
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    id String

    getPiKeys Result

    The following output properties are available:

    Id string
    Keys List<GetPiKeysKey>
    (List) List of all the SSH keys.
    PiCloudInstanceId string
    Id string
    Keys []GetPiKeysKey
    (List) List of all the SSH keys.
    PiCloudInstanceId string
    id String
    keys List<GetPiKeysKey>
    (List) List of all the SSH keys.
    piCloudInstanceId String
    id string
    keys GetPiKeysKey[]
    (List) List of all the SSH keys.
    piCloudInstanceId string
    id str
    keys Sequence[GetPiKeysKey]
    (List) List of all the SSH keys.
    pi_cloud_instance_id str
    id String
    keys List<Property Map>
    (List) List of all the SSH keys.
    piCloudInstanceId String

    Supporting Types

    GetPiKeysKey

    CreationDate string
    (String) Date of SSH Key creation.
    Name string
    (String) User defined name for the SSH key.
    SshKey string
    (String) SSH RSA key.
    CreationDate string
    (String) Date of SSH Key creation.
    Name string
    (String) User defined name for the SSH key.
    SshKey string
    (String) SSH RSA key.
    creationDate String
    (String) Date of SSH Key creation.
    name String
    (String) User defined name for the SSH key.
    sshKey String
    (String) SSH RSA key.
    creationDate string
    (String) Date of SSH Key creation.
    name string
    (String) User defined name for the SSH key.
    sshKey string
    (String) SSH RSA key.
    creation_date str
    (String) Date of SSH Key creation.
    name str
    (String) User defined name for the SSH key.
    ssh_key str
    (String) SSH RSA key.
    creationDate String
    (String) Date of SSH Key creation.
    name String
    (String) User defined name for the SSH key.
    sshKey String
    (String) SSH RSA 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.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud