1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. getComputeKeypairV2
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

opentelekomcloud.getComputeKeypairV2

Explore with Pulumi AI

opentelekomcloud logo
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

    Up-to-date reference of API arguments for ECS keypair you can get at documentation portal

    Use this data source to get details about Compute SSH key pairs from OpenTelekomCloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const kp1 = new opentelekomcloud.ComputeKeypairV2("kp1", {publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALRzbIOR9HUYNwfKtII/et98eGXDJhf8YxHf9BtRdAU"});
    const key1 = opentelekomcloud.getComputeKeypairV2({
        name: "key_1",
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    kp1 = opentelekomcloud.ComputeKeypairV2("kp1", public_key="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALRzbIOR9HUYNwfKtII/et98eGXDJhf8YxHf9BtRdAU")
    key1 = opentelekomcloud.get_compute_keypair_v2(name="key_1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := opentelekomcloud.NewComputeKeypairV2(ctx, "kp1", &opentelekomcloud.ComputeKeypairV2Args{
    			PublicKey: pulumi.String("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALRzbIOR9HUYNwfKtII/et98eGXDJhf8YxHf9BtRdAU"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opentelekomcloud.LookupComputeKeypairV2(ctx, &opentelekomcloud.LookupComputeKeypairV2Args{
    			Name: pulumi.StringRef("key_1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var kp1 = new Opentelekomcloud.ComputeKeypairV2("kp1", new()
        {
            PublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALRzbIOR9HUYNwfKtII/et98eGXDJhf8YxHf9BtRdAU",
        });
    
        var key1 = Opentelekomcloud.GetComputeKeypairV2.Invoke(new()
        {
            Name = "key_1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.ComputeKeypairV2;
    import com.pulumi.opentelekomcloud.ComputeKeypairV2Args;
    import com.pulumi.opentelekomcloud.OpentelekomcloudFunctions;
    import com.pulumi.opentelekomcloud.inputs.GetComputeKeypairV2Args;
    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 kp1 = new ComputeKeypairV2("kp1", ComputeKeypairV2Args.builder()
                .publicKey("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALRzbIOR9HUYNwfKtII/et98eGXDJhf8YxHf9BtRdAU")
                .build());
    
            final var key1 = OpentelekomcloudFunctions.getComputeKeypairV2(GetComputeKeypairV2Args.builder()
                .name("key_1")
                .build());
    
        }
    }
    
    resources:
      kp1:
        type: opentelekomcloud:ComputeKeypairV2
        properties:
          publicKey: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALRzbIOR9HUYNwfKtII/et98eGXDJhf8YxHf9BtRdAU
    variables:
      key1:
        fn::invoke:
          function: opentelekomcloud:getComputeKeypairV2
          arguments:
            name: key_1
    

    Using getComputeKeypairV2

    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 getComputeKeypairV2(args: GetComputeKeypairV2Args, opts?: InvokeOptions): Promise<GetComputeKeypairV2Result>
    function getComputeKeypairV2Output(args: GetComputeKeypairV2OutputArgs, opts?: InvokeOptions): Output<GetComputeKeypairV2Result>
    def get_compute_keypair_v2(id: Optional[str] = None,
                               name: Optional[str] = None,
                               name_regex: Optional[str] = None,
                               region: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetComputeKeypairV2Result
    def get_compute_keypair_v2_output(id: Optional[pulumi.Input[str]] = None,
                               name: Optional[pulumi.Input[str]] = None,
                               name_regex: Optional[pulumi.Input[str]] = None,
                               region: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetComputeKeypairV2Result]
    func LookupComputeKeypairV2(ctx *Context, args *LookupComputeKeypairV2Args, opts ...InvokeOption) (*LookupComputeKeypairV2Result, error)
    func LookupComputeKeypairV2Output(ctx *Context, args *LookupComputeKeypairV2OutputArgs, opts ...InvokeOption) LookupComputeKeypairV2ResultOutput

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

    public static class GetComputeKeypairV2 
    {
        public static Task<GetComputeKeypairV2Result> InvokeAsync(GetComputeKeypairV2Args args, InvokeOptions? opts = null)
        public static Output<GetComputeKeypairV2Result> Invoke(GetComputeKeypairV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetComputeKeypairV2Result> getComputeKeypairV2(GetComputeKeypairV2Args args, InvokeOptions options)
    public static Output<GetComputeKeypairV2Result> getComputeKeypairV2(GetComputeKeypairV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: opentelekomcloud:index/getComputeKeypairV2:getComputeKeypairV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Name string
    The name of the keypair.
    NameRegex string
    A regex string to apply to the keypairs list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    Region string
    Id string
    Name string
    The name of the keypair.
    NameRegex string
    A regex string to apply to the keypairs list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    Region string
    id String
    name String
    The name of the keypair.
    nameRegex String
    A regex string to apply to the keypairs list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region String
    id string
    name string
    The name of the keypair.
    nameRegex string
    A regex string to apply to the keypairs list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region string
    id str
    name str
    The name of the keypair.
    name_regex str
    A regex string to apply to the keypairs list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region str
    id String
    name String
    The name of the keypair.
    nameRegex String
    A regex string to apply to the keypairs list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region String

    getComputeKeypairV2 Result

    The following output properties are available:

    Fingerprint string
    It is the fingerprint information about the key pair.
    Id string
    PublicKey string
    It gives the information about the public key in the key pair.
    Region string
    UserId string
    The user id of the owner of the key pair. Not filled by API now.
    Name string
    See Argument Reference above.
    NameRegex string
    Fingerprint string
    It is the fingerprint information about the key pair.
    Id string
    PublicKey string
    It gives the information about the public key in the key pair.
    Region string
    UserId string
    The user id of the owner of the key pair. Not filled by API now.
    Name string
    See Argument Reference above.
    NameRegex string
    fingerprint String
    It is the fingerprint information about the key pair.
    id String
    publicKey String
    It gives the information about the public key in the key pair.
    region String
    userId String
    The user id of the owner of the key pair. Not filled by API now.
    name String
    See Argument Reference above.
    nameRegex String
    fingerprint string
    It is the fingerprint information about the key pair.
    id string
    publicKey string
    It gives the information about the public key in the key pair.
    region string
    userId string
    The user id of the owner of the key pair. Not filled by API now.
    name string
    See Argument Reference above.
    nameRegex string
    fingerprint str
    It is the fingerprint information about the key pair.
    id str
    public_key str
    It gives the information about the public key in the key pair.
    region str
    user_id str
    The user id of the owner of the key pair. Not filled by API now.
    name str
    See Argument Reference above.
    name_regex str
    fingerprint String
    It is the fingerprint information about the key pair.
    id String
    publicKey String
    It gives the information about the public key in the key pair.
    region String
    userId String
    The user id of the owner of the key pair. Not filled by API now.
    name String
    See Argument Reference above.
    nameRegex String

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    opentelekomcloud logo
    opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud