tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
tencentcloud.getKeyPairs
Start a Neo task
Explain and create a tencentcloud.getKeyPairs resource
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
Use this data source to query key pairs.
Example Usage
Query key pairs by key ID
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const keyId = tencentcloud.getKeyPairs({
keyId: "skey-ie97i3ml",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
key_id = tencentcloud.get_key_pairs(key_id="skey-ie97i3ml")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.GetKeyPairs(ctx, &tencentcloud.GetKeyPairsArgs{
KeyId: pulumi.StringRef("skey-ie97i3ml"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var keyId = Tencentcloud.GetKeyPairs.Invoke(new()
{
KeyId = "skey-ie97i3ml",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetKeyPairsArgs;
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 keyId = TencentcloudFunctions.getKeyPairs(GetKeyPairsArgs.builder()
.keyId("skey-ie97i3ml")
.build());
}
}
variables:
keyId:
fn::invoke:
function: tencentcloud:getKeyPairs
arguments:
keyId: skey-ie97i3ml
Query key pairs by key name
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const keyName = tencentcloud.getKeyPairs({
keyName: "^test$",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
key_name = tencentcloud.get_key_pairs(key_name="^test$")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.GetKeyPairs(ctx, &tencentcloud.GetKeyPairsArgs{
KeyName: pulumi.StringRef("^test$"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var keyName = Tencentcloud.GetKeyPairs.Invoke(new()
{
KeyName = "^test$",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetKeyPairsArgs;
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 keyName = TencentcloudFunctions.getKeyPairs(GetKeyPairsArgs.builder()
.keyName("^test$")
.build());
}
}
variables:
keyName:
fn::invoke:
function: tencentcloud:getKeyPairs
arguments:
keyName: ^test$
Using getKeyPairs
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 getKeyPairs(args: GetKeyPairsArgs, opts?: InvokeOptions): Promise<GetKeyPairsResult>
function getKeyPairsOutput(args: GetKeyPairsOutputArgs, opts?: InvokeOptions): Output<GetKeyPairsResult>def get_key_pairs(id: Optional[str] = None,
key_id: Optional[str] = None,
key_name: Optional[str] = None,
project_id: Optional[float] = None,
result_output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetKeyPairsResult
def get_key_pairs_output(id: Optional[pulumi.Input[str]] = None,
key_id: Optional[pulumi.Input[str]] = None,
key_name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[float]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKeyPairsResult]func GetKeyPairs(ctx *Context, args *GetKeyPairsArgs, opts ...InvokeOption) (*GetKeyPairsResult, error)
func GetKeyPairsOutput(ctx *Context, args *GetKeyPairsOutputArgs, opts ...InvokeOption) GetKeyPairsResultOutput> Note: This function is named GetKeyPairs in the Go SDK.
public static class GetKeyPairs
{
public static Task<GetKeyPairsResult> InvokeAsync(GetKeyPairsArgs args, InvokeOptions? opts = null)
public static Output<GetKeyPairsResult> Invoke(GetKeyPairsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetKeyPairsResult> getKeyPairs(GetKeyPairsArgs args, InvokeOptions options)
public static Output<GetKeyPairsResult> getKeyPairs(GetKeyPairsArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getKeyPairs:getKeyPairs
arguments:
# arguments dictionaryThe following arguments are supported:
- Id string
- Key
Id string - ID of the key pair to be queried.
- Key
Name string - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - Project
Id double - Project ID of the key pair to be queried.
- Result
Output stringFile - Used to save results.
- Id string
- Key
Id string - ID of the key pair to be queried.
- Key
Name string - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - Project
Id float64 - Project ID of the key pair to be queried.
- Result
Output stringFile - Used to save results.
- id String
- key
Id String - ID of the key pair to be queried.
- key
Name String - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project
Id Double - Project ID of the key pair to be queried.
- result
Output StringFile - Used to save results.
- id string
- key
Id string - ID of the key pair to be queried.
- key
Name string - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project
Id number - Project ID of the key pair to be queried.
- result
Output stringFile - Used to save results.
- id str
- key_
id str - ID of the key pair to be queried.
- key_
name str - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project_
id float - Project ID of the key pair to be queried.
- result_
output_ strfile - Used to save results.
- id String
- key
Id String - ID of the key pair to be queried.
- key
Name String - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project
Id Number - Project ID of the key pair to be queried.
- result
Output StringFile - Used to save results.
getKeyPairs Result
The following output properties are available:
- Id string
- Key
Pair List<GetLists Key Pairs Key Pair List> - An information list of key pair. Each element contains the following attributes:
- Key
Id string - ID of the key pair.
- Key
Name string - Name of the key pair.
- Project
Id double - Project ID of the key pair.
- Result
Output stringFile
- Id string
- Key
Pair []GetLists Key Pairs Key Pair List - An information list of key pair. Each element contains the following attributes:
- Key
Id string - ID of the key pair.
- Key
Name string - Name of the key pair.
- Project
Id float64 - Project ID of the key pair.
- Result
Output stringFile
- id String
- key
Pair List<GetLists Key Pairs Key Pair List> - An information list of key pair. Each element contains the following attributes:
- key
Id String - ID of the key pair.
- key
Name String - Name of the key pair.
- project
Id Double - Project ID of the key pair.
- result
Output StringFile
- id string
- key
Pair GetLists Key Pairs Key Pair List[] - An information list of key pair. Each element contains the following attributes:
- key
Id string - ID of the key pair.
- key
Name string - Name of the key pair.
- project
Id number - Project ID of the key pair.
- result
Output stringFile
- id str
- key_
pair_ Sequence[Getlists Key Pairs Key Pair List] - An information list of key pair. Each element contains the following attributes:
- key_
id str - ID of the key pair.
- key_
name str - Name of the key pair.
- project_
id float - Project ID of the key pair.
- result_
output_ strfile
- id String
- key
Pair List<Property Map>Lists - An information list of key pair. Each element contains the following attributes:
- key
Id String - ID of the key pair.
- key
Name String - Name of the key pair.
- project
Id Number - Project ID of the key pair.
- result
Output StringFile
Supporting Types
GetKeyPairsKeyPairList
- Create
Time string - Creation time of the key pair.
- Key
Id string - ID of the key pair to be queried.
- Key
Name string - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - Project
Id double - Project ID of the key pair to be queried.
- Public
Key string - public key of the key pair.
- Create
Time string - Creation time of the key pair.
- Key
Id string - ID of the key pair to be queried.
- Key
Name string - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - Project
Id float64 - Project ID of the key pair to be queried.
- Public
Key string - public key of the key pair.
- create
Time String - Creation time of the key pair.
- key
Id String - ID of the key pair to be queried.
- key
Name String - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project
Id Double - Project ID of the key pair to be queried.
- public
Key String - public key of the key pair.
- create
Time string - Creation time of the key pair.
- key
Id string - ID of the key pair to be queried.
- key
Name string - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project
Id number - Project ID of the key pair to be queried.
- public
Key string - public key of the key pair.
- create_
time str - Creation time of the key pair.
- key_
id str - ID of the key pair to be queried.
- key_
name str - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project_
id float - Project ID of the key pair to be queried.
- public_
key str - public key of the key pair.
- create
Time String - Creation time of the key pair.
- key
Id String - ID of the key pair to be queried.
- key
Name String - Name of the key pair to be queried. Support regular expression search, only
^and$are supported. - project
Id Number - Project ID of the key pair to be queried.
- public
Key String - public key of the key pair.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
