linode.getSshkeys
Explore with Pulumi AI
linode.SshKey
provides access to a filtered list of SSH Keys in the Profile of the User identified by the access token.
For more information, see the Linode APIv4 docs.
Example Usage
The following example shows how the resource might be used to obtain the names of the SSH Keys configured on the Linode user profile.
The following example shows how one might use this data source to access information about a Linode Kernel.
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const filteredSsh = linode.getSshkeys({
filters: [
{
name: "label",
values: ["my-ssh"],
},
{
name: "ssh_key",
values: ["RSA-6522525"],
},
],
});
import pulumi
import pulumi_linode as linode
filtered_ssh = linode.get_sshkeys(filters=[
{
"name": "label",
"values": ["my-ssh"],
},
{
"name": "ssh_key",
"values": ["RSA-6522525"],
},
])
package main
import (
"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := linode.GetSshkeys(ctx, &linode.GetSshkeysArgs{
Filters: []linode.GetSshkeysFilter{
{
Name: "label",
Values: []string{
"my-ssh",
},
},
{
Name: "ssh_key",
Values: []string{
"RSA-6522525",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() =>
{
var filteredSsh = Linode.GetSshkeys.Invoke(new()
{
Filters = new[]
{
new Linode.Inputs.GetSshkeysFilterInputArgs
{
Name = "label",
Values = new[]
{
"my-ssh",
},
},
new Linode.Inputs.GetSshkeysFilterInputArgs
{
Name = "ssh_key",
Values = new[]
{
"RSA-6522525",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetSshkeysArgs;
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 filteredSsh = LinodeFunctions.getSshkeys(GetSshkeysArgs.builder()
.filters(
GetSshkeysFilterArgs.builder()
.name("label")
.values("my-ssh")
.build(),
GetSshkeysFilterArgs.builder()
.name("ssh_key")
.values("RSA-6522525")
.build())
.build());
}
}
variables:
filteredSsh:
fn::invoke:
Function: linode:getSshkeys
Arguments:
filters:
- name: label
values:
- my-ssh
- name: ssh_key
values:
- RSA-6522525
Filterable Fields
id
label
ssh_key
Using getSshkeys
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 getSshkeys(args: GetSshkeysArgs, opts?: InvokeOptions): Promise<GetSshkeysResult>
function getSshkeysOutput(args: GetSshkeysOutputArgs, opts?: InvokeOptions): Output<GetSshkeysResult>
def get_sshkeys(filters: Optional[Sequence[GetSshkeysFilter]] = None,
order: Optional[str] = None,
order_by: Optional[str] = None,
sshkeys: Optional[Sequence[GetSshkeysSshkey]] = None,
opts: Optional[InvokeOptions] = None) -> GetSshkeysResult
def get_sshkeys_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSshkeysFilterArgs]]]] = None,
order: Optional[pulumi.Input[str]] = None,
order_by: Optional[pulumi.Input[str]] = None,
sshkeys: Optional[pulumi.Input[Sequence[pulumi.Input[GetSshkeysSshkeyArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSshkeysResult]
func GetSshkeys(ctx *Context, args *GetSshkeysArgs, opts ...InvokeOption) (*GetSshkeysResult, error)
func GetSshkeysOutput(ctx *Context, args *GetSshkeysOutputArgs, opts ...InvokeOption) GetSshkeysResultOutput
> Note: This function is named GetSshkeys
in the Go SDK.
public static class GetSshkeys
{
public static Task<GetSshkeysResult> InvokeAsync(GetSshkeysArgs args, InvokeOptions? opts = null)
public static Output<GetSshkeysResult> Invoke(GetSshkeysInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSshkeysResult> getSshkeys(GetSshkeysArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: linode:index/getSshkeys:getSshkeys
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Sshkeys Filter> - Order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - Order
By string - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- Sshkeys
List<Get
Sshkeys Sshkey>
- Filters
[]Get
Sshkeys Filter - Order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - Order
By string - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- Sshkeys
[]Get
Sshkeys Sshkey
- filters
List<Get
Sshkeys Filter> - order String
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By String - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- sshkeys
List<Get
Sshkeys Sshkey>
- filters
Get
Sshkeys Filter[] - order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By string - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- sshkeys
Get
Sshkeys Sshkey[]
- filters
Sequence[Get
Sshkeys Filter] - order str
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order_
by str - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- sshkeys
Sequence[Get
Sshkeys Sshkey]
- filters List<Property Map>
- order String
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By String - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- sshkeys List<Property Map>
getSshkeys Result
The following output properties are available:
- Id string
- The ID of the SSH Key.
- Filters
List<Get
Sshkeys Filter> - Order string
- Order
By string - Sshkeys
List<Get
Sshkeys Sshkey>
- Id string
- The ID of the SSH Key.
- Filters
[]Get
Sshkeys Filter - Order string
- Order
By string - Sshkeys
[]Get
Sshkeys Sshkey
- id String
- The ID of the SSH Key.
- filters
List<Get
Sshkeys Filter> - order String
- order
By String - sshkeys
List<Get
Sshkeys Sshkey>
- id string
- The ID of the SSH Key.
- filters
Get
Sshkeys Filter[] - order string
- order
By string - sshkeys
Get
Sshkeys Sshkey[]
- id str
- The ID of the SSH Key.
- filters
Sequence[Get
Sshkeys Filter] - order str
- order_
by str - sshkeys
Sequence[Get
Sshkeys Sshkey]
- id String
- The ID of the SSH Key.
- filters List<Property Map>
- order String
- order
By String - sshkeys List<Property Map>
Supporting Types
GetSshkeysFilter
- Name string
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- Values List<string>
- A list of values for the filter to allow. These values should all be in string form.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- Name string
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- Values []string
- A list of values for the filter to allow. These values should all be in string form.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name String
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values List<String>
- A list of values for the filter to allow. These values should all be in string form.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name string
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values string[]
- A list of values for the filter to allow. These values should all be in string form.
- match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name str
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values Sequence[str]
- A list of values for the filter to allow. These values should all be in string form.
- match_
by str - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name String
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values List<String>
- A list of values for the filter to allow. These values should all be in string form.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
GetSshkeysSshkey
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linode
Terraform Provider.