OpenStack

Pulumi Official
Package maintained by Pulumi
v3.9.0 published on Thursday, Aug 4, 2022 by Pulumi

getKeypair

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

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var kp = Output.Create(OpenStack.Compute.GetKeypair.InvokeAsync(new OpenStack.Compute.GetKeypairArgs
        {
            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 = pulumi.output(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,
                opts: Optional[InvokeOptions] = None) -> GetKeypairResult
def get_keypair_output(name: Optional[pulumi.Input[str]] = None,
                region: 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.