openstack.compute.getKeypair
Explore with Pulumi AI
Use this data source to get the ID and public key of an OpenStack keypair.
Example Usage
using System.Collections.Generic;
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,
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:
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.
- Public
Key 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.
- Public
Key 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.
- public
Key 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.
- public
Key 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.
- public
Key String The OpenSSH-formatted public key of the keypair.
- region 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.