Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien
vultr.getSshKey
Explore with Pulumi AI
Get information about a Vultr SSH key. This data source provides the name, public SSH key, and the creation date for your Vultr SSH key.
Example Usage
Get the information for an SSH key by name
:
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@pulumi/vultr";
const mySshKey = vultr.getSshKey({
filters: [{
name: "name",
values: ["my-ssh-key-name"],
}],
});
import pulumi
import pulumi_vultr as vultr
my_ssh_key = vultr.get_ssh_key(filters=[vultr.GetSshKeyFilterArgs(
name="name",
values=["my-ssh-key-name"],
)])
package main
import (
"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vultr.GetSshKey(ctx, &vultr.GetSshKeyArgs{
Filters: []vultr.GetSshKeyFilter{
{
Name: "name",
Values: []string{
"my-ssh-key-name",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = Pulumi.Vultr;
return await Deployment.RunAsync(() =>
{
var mySshKey = Vultr.GetSshKey.Invoke(new()
{
Filters = new[]
{
new Vultr.Inputs.GetSshKeyFilterInputArgs
{
Name = "name",
Values = new[]
{
"my-ssh-key-name",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.VultrFunctions;
import com.pulumi.vultr.inputs.GetSshKeyArgs;
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 mySshKey = VultrFunctions.getSshKey(GetSshKeyArgs.builder()
.filters(GetSshKeyFilterArgs.builder()
.name("name")
.values("my-ssh-key-name")
.build())
.build());
}
}
variables:
mySshKey:
fn::invoke:
Function: vultr:getSshKey
Arguments:
filters:
- name: name
values:
- my-ssh-key-name
Using getSshKey
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 getSshKey(args: GetSshKeyArgs, opts?: InvokeOptions): Promise<GetSshKeyResult>
function getSshKeyOutput(args: GetSshKeyOutputArgs, opts?: InvokeOptions): Output<GetSshKeyResult>
def get_ssh_key(filters: Optional[Sequence[GetSshKeyFilter]] = None,
opts: Optional[InvokeOptions] = None) -> GetSshKeyResult
def get_ssh_key_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSshKeyFilterArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSshKeyResult]
func GetSshKey(ctx *Context, args *GetSshKeyArgs, opts ...InvokeOption) (*GetSshKeyResult, error)
func GetSshKeyOutput(ctx *Context, args *GetSshKeyOutputArgs, opts ...InvokeOption) GetSshKeyResultOutput
> Note: This function is named GetSshKey
in the Go SDK.
public static class GetSshKey
{
public static Task<GetSshKeyResult> InvokeAsync(GetSshKeyArgs args, InvokeOptions? opts = null)
public static Output<GetSshKeyResult> Invoke(GetSshKeyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSshKeyResult> getSshKey(GetSshKeyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: vultr:index/getSshKey:getSshKey
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<ediri.
Vultr. Inputs. Get Ssh Key Filter> - Query parameters for finding SSH keys.
- Filters
[]Get
Ssh Key Filter - Query parameters for finding SSH keys.
- filters
List<Get
Ssh Key Filter> - Query parameters for finding SSH keys.
- filters
Get
Ssh Key Filter[] - Query parameters for finding SSH keys.
- filters
Sequence[Get
Ssh Key Filter] - Query parameters for finding SSH keys.
- filters List<Property Map>
- Query parameters for finding SSH keys.
getSshKey Result
The following output properties are available:
- Date
Created string - The date the SSH key was added to your Vultr account.
- Id string
- The ID of the SSH key.
- Name string
- The name of the SSH key.
- Ssh
Key string - The public SSH key.
- Filters
List<ediri.
Vultr. Outputs. Get Ssh Key Filter>
- Date
Created string - The date the SSH key was added to your Vultr account.
- Id string
- The ID of the SSH key.
- Name string
- The name of the SSH key.
- Ssh
Key string - The public SSH key.
- Filters
[]Get
Ssh Key Filter
- date
Created String - The date the SSH key was added to your Vultr account.
- id String
- The ID of the SSH key.
- name String
- The name of the SSH key.
- ssh
Key String - The public SSH key.
- filters
List<Get
Ssh Key Filter>
- date
Created string - The date the SSH key was added to your Vultr account.
- id string
- The ID of the SSH key.
- name string
- The name of the SSH key.
- ssh
Key string - The public SSH key.
- filters
Get
Ssh Key Filter[]
- date_
created str - The date the SSH key was added to your Vultr account.
- id str
- The ID of the SSH key.
- name str
- The name of the SSH key.
- ssh_
key str - The public SSH key.
- filters
Sequence[Get
Ssh Key Filter]
- date
Created String - The date the SSH key was added to your Vultr account.
- id String
- The ID of the SSH key.
- name String
- The name of the SSH key.
- ssh
Key String - The public SSH key.
- filters List<Property Map>
Supporting Types
GetSshKeyFilter
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.