1. Packages
  2. OpenStack
  3. API Docs
  4. compute
  5. getKeypair
OpenStack v3.13.3 published on Friday, Aug 11, 2023 by Pulumi

openstack.compute.getKeypair

Explore with Pulumi AI

openstack logo
OpenStack v3.13.3 published on Friday, Aug 11, 2023 by Pulumi

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

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var kp = OpenStack.Compute.GetKeypair.Invoke(new()
        {
            Name = "sand",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.LookupKeypair(ctx, &compute.LookupKeypairArgs{
    			Name: "sand",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.compute.ComputeFunctions;
    import com.pulumi.openstack.compute.inputs.GetKeypairArgs;
    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 kp = ComputeFunctions.getKeypair(GetKeypairArgs.builder()
                .name("sand")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_openstack as openstack
    
    kp = openstack.compute.get_keypair(name="sand")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const kp = openstack.compute.getKeypair({
        name: "sand",
    });
    
    variables:
      kp:
        fn::invoke:
          Function: openstack:compute:getKeypair
          Arguments:
            name: sand
    

    Using getKeypair

    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 getKeypair(args: GetKeypairArgs, opts?: InvokeOptions): Promise<GetKeypairResult>
    function getKeypairOutput(args: GetKeypairOutputArgs, opts?: InvokeOptions): Output<GetKeypairResult>
    def get_keypair(name: Optional[str] = None,
                    region: Optional[str] = None,
                    user_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetKeypairResult
    def get_keypair_output(name: Optional[pulumi.Input[str]] = None,
                    region: Optional[pulumi.Input[str]] = None,
                    user_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetKeypairResult]
    func LookupKeypair(ctx *Context, args *LookupKeypairArgs, opts ...InvokeOption) (*LookupKeypairResult, error)
    func LookupKeypairOutput(ctx *Context, args *LookupKeypairOutputArgs, opts ...InvokeOption) LookupKeypairResultOutput

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

    public static class GetKeypair 
    {
        public static Task<GetKeypairResult> InvokeAsync(GetKeypairArgs args, InvokeOptions? opts = null)
        public static Output<GetKeypairResult> Invoke(GetKeypairInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKeypairResult> getKeypair(GetKeypairArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:compute/getKeypair:getKeypair
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string

    The unique name of the keypair.

    Region string

    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.

    UserId string

    The user id of the owner of the key pair. This parameter can be specified only if the provider is configured to use the credentials of an OpenStack administrator.

    Name string

    The unique name of the keypair.

    Region string

    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.

    UserId string

    The user id of the owner of the key pair. This parameter can be specified only if the provider is configured to use the credentials of an OpenStack administrator.

    name String

    The unique name of the keypair.

    region String

    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.

    userId String

    The user id of the owner of the key pair. This parameter can be specified only if the provider is configured to use the credentials of an OpenStack administrator.

    name string

    The unique name of the keypair.

    region string

    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.

    userId string

    The user id of the owner of the key pair. This parameter can be specified only if the provider is configured to use the credentials of an OpenStack administrator.

    name str

    The unique name of the keypair.

    region str

    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.

    user_id str

    The user id of the owner of the key pair. This parameter can be specified only if the provider is configured to use the credentials of an OpenStack administrator.

    name String

    The unique name of the keypair.

    region String

    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.

    userId String

    The user id of the owner of the key pair. This parameter can be specified only if the provider is configured to use the credentials of an OpenStack administrator.

    getKeypair Result

    The following output properties are available:

    Fingerprint string

    The fingerprint of the OpenSSH key.

    Id string

    The provider-assigned unique ID for this managed resource.

    Name string

    See Argument Reference above.

    PublicKey string

    The OpenSSH-formatted public key of the keypair.

    Region string

    See Argument Reference above.

    UserId string

    See Argument Reference above.

    Fingerprint string

    The fingerprint of the OpenSSH key.

    Id string

    The provider-assigned unique ID for this managed resource.

    Name string

    See Argument Reference above.

    PublicKey string

    The OpenSSH-formatted public key of the keypair.

    Region string

    See Argument Reference above.

    UserId string

    See Argument Reference above.

    fingerprint String

    The fingerprint of the OpenSSH key.

    id String

    The provider-assigned unique ID for this managed resource.

    name String

    See Argument Reference above.

    publicKey String

    The OpenSSH-formatted public key of the keypair.

    region String

    See Argument Reference above.

    userId String

    See Argument Reference above.

    fingerprint string

    The fingerprint of the OpenSSH key.

    id string

    The provider-assigned unique ID for this managed resource.

    name string

    See Argument Reference above.

    publicKey string

    The OpenSSH-formatted public key of the keypair.

    region string

    See Argument Reference above.

    userId string

    See Argument Reference above.

    fingerprint str

    The fingerprint of the OpenSSH key.

    id str

    The provider-assigned unique ID for this managed resource.

    name str

    See Argument Reference above.

    public_key str

    The OpenSSH-formatted public key of the keypair.

    region str

    See Argument Reference above.

    user_id str

    See Argument Reference above.

    fingerprint String

    The fingerprint of the OpenSSH key.

    id String

    The provider-assigned unique ID for this managed resource.

    name String

    See Argument Reference above.

    publicKey String

    The OpenSSH-formatted public key of the keypair.

    region String

    See Argument Reference above.

    userId String

    See Argument Reference above.

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the openstack Terraform Provider.

    openstack logo
    OpenStack v3.13.3 published on Friday, Aug 11, 2023 by Pulumi