1. Packages
  2. Vkcs Provider
  3. API Docs
  4. getComputeKeypair
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

vkcs.getComputeKeypair

Explore with Pulumi AI

vkcs logo
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

    Use this data source to get the ID and public key of an VKCS keypair.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vkcs from "@pulumi/vkcs";
    
    const generatedKey = vkcs.getComputeKeypair({
        name: "generated-key-tf-example",
    });
    
    import pulumi
    import pulumi_vkcs as vkcs
    
    generated_key = vkcs.get_compute_keypair(name="generated-key-tf-example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vkcs.LookupComputeKeypair(ctx, &vkcs.LookupComputeKeypairArgs{
    			Name: "generated-key-tf-example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vkcs = Pulumi.Vkcs;
    
    return await Deployment.RunAsync(() => 
    {
        var generatedKey = Vkcs.GetComputeKeypair.Invoke(new()
        {
            Name = "generated-key-tf-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vkcs.VkcsFunctions;
    import com.pulumi.vkcs.inputs.GetComputeKeypairArgs;
    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 generatedKey = VkcsFunctions.getComputeKeypair(GetComputeKeypairArgs.builder()
                .name("generated-key-tf-example")
                .build());
    
        }
    }
    
    variables:
      generatedKey:
        fn::invoke:
          function: vkcs:getComputeKeypair
          arguments:
            name: generated-key-tf-example
    

    Using getComputeKeypair

    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 getComputeKeypair(args: GetComputeKeypairArgs, opts?: InvokeOptions): Promise<GetComputeKeypairResult>
    function getComputeKeypairOutput(args: GetComputeKeypairOutputArgs, opts?: InvokeOptions): Output<GetComputeKeypairResult>
    def get_compute_keypair(id: Optional[str] = None,
                            name: Optional[str] = None,
                            region: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetComputeKeypairResult
    def get_compute_keypair_output(id: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            region: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetComputeKeypairResult]
    func LookupComputeKeypair(ctx *Context, args *LookupComputeKeypairArgs, opts ...InvokeOption) (*LookupComputeKeypairResult, error)
    func LookupComputeKeypairOutput(ctx *Context, args *LookupComputeKeypairOutputArgs, opts ...InvokeOption) LookupComputeKeypairResultOutput

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

    public static class GetComputeKeypair 
    {
        public static Task<GetComputeKeypairResult> InvokeAsync(GetComputeKeypairArgs args, InvokeOptions? opts = null)
        public static Output<GetComputeKeypairResult> Invoke(GetComputeKeypairInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetComputeKeypairResult> getComputeKeypair(GetComputeKeypairArgs args, InvokeOptions options)
    public static Output<GetComputeKeypairResult> getComputeKeypair(GetComputeKeypairArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vkcs:index/getComputeKeypair:getComputeKeypair
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    required string → The unique name of the keypair.
    Id string
    string → ID of the resource.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    Name string
    required string → The unique name of the keypair.
    Id string
    string → ID of the resource.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    name String
    required string → The unique name of the keypair.
    id String
    string → ID of the resource.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    name string
    required string → The unique name of the keypair.
    id string
    string → ID of the resource.
    region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    name str
    required string → The unique name of the keypair.
    id str
    string → ID of the resource.
    region str
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    name String
    required string → The unique name of the keypair.
    id String
    string → ID of the resource.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.

    getComputeKeypair Result

    The following output properties are available:

    Fingerprint string
    string → The fingerprint of the OpenSSH key.
    Id string
    string → ID of the resource.
    Name string
    PublicKey string
    string → The OpenSSH-formatted public key of the keypair.
    Region string
    Fingerprint string
    string → The fingerprint of the OpenSSH key.
    Id string
    string → ID of the resource.
    Name string
    PublicKey string
    string → The OpenSSH-formatted public key of the keypair.
    Region string
    fingerprint String
    string → The fingerprint of the OpenSSH key.
    id String
    string → ID of the resource.
    name String
    publicKey String
    string → The OpenSSH-formatted public key of the keypair.
    region String
    fingerprint string
    string → The fingerprint of the OpenSSH key.
    id string
    string → ID of the resource.
    name string
    publicKey string
    string → The OpenSSH-formatted public key of the keypair.
    region string
    fingerprint str
    string → The fingerprint of the OpenSSH key.
    id str
    string → ID of the resource.
    name str
    public_key str
    string → The OpenSSH-formatted public key of the keypair.
    region str
    fingerprint String
    string → The fingerprint of the OpenSSH key.
    id String
    string → ID of the resource.
    name String
    publicKey String
    string → The OpenSSH-formatted public key of the keypair.
    region String

    Package Details

    Repository
    vkcs vk-cs/terraform-provider-vkcs
    License
    Notes
    This Pulumi package is based on the vkcs Terraform Provider.
    vkcs logo
    vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs