GetKeyPairs

This data source provides a list of key pairs in an Alibaba Cloud account according to the specified filters.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        // Declare the data source
        var defaultKeyPair = new AliCloud.Ecs.KeyPair("defaultKeyPair", new AliCloud.Ecs.KeyPairArgs
        {
            KeyName = "keyPairDatasource",
        });
        var defaultKeyPairs = defaultKeyPair.KeyName.Apply(keyName => AliCloud.Ecs.GetKeyPairs.InvokeAsync(new AliCloud.Ecs.GetKeyPairsArgs
        {
            NameRegex = keyName,
        }));
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

# Declare the data source
default_key_pair = alicloud.ecs.KeyPair("defaultKeyPair", key_name="keyPairDatasource")
default_key_pairs = default_key_pair.key_name.apply(lambda key_name: alicloud.ecs.get_key_pairs(name_regex=key_name))
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Declare the data source
const defaultKeyPair = new alicloud.ecs.KeyPair("default", {
    keyName: "keyPairDatasource",
});
const defaultKeyPairs = defaultKeyPair.keyName.apply(keyName => alicloud.ecs.getKeyPairs({
    nameRegex: keyName,
}, { async: true }));

Using GetKeyPairs

function getKeyPairs(args: GetKeyPairsArgs, opts?: InvokeOptions): Promise<GetKeyPairsResult>
function  get_key_pairs(finger_print=None, ids=None, name_regex=None, output_file=None, resource_group_id=None, tags=None, opts=None)
func GetKeyPairs(ctx *Context, args *GetKeyPairsArgs, opts ...InvokeOption) (*GetKeyPairsResult, error)
public static class GetKeyPairs {
    public static Task<GetKeyPairsResult> InvokeAsync(GetKeyPairsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

FingerPrint string

A finger print used to retrieve specified key pair.

Ids List<string>

A list of key pair IDs.

NameRegex string

A regex string to apply to the resulting key pairs.

OutputFile string
ResourceGroupId string

The Id of resource group which the key pair belongs.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

FingerPrint string

A finger print used to retrieve specified key pair.

Ids []string

A list of key pair IDs.

NameRegex string

A regex string to apply to the resulting key pairs.

OutputFile string
ResourceGroupId string

The Id of resource group which the key pair belongs.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

fingerPrint string

A finger print used to retrieve specified key pair.

ids string[]

A list of key pair IDs.

nameRegex string

A regex string to apply to the resulting key pairs.

outputFile string
resourceGroupId string

The Id of resource group which the key pair belongs.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

finger_print str

A finger print used to retrieve specified key pair.

ids List[str]

A list of key pair IDs.

name_regex str

A regex string to apply to the resulting key pairs.

output_file str
resource_group_id str

The Id of resource group which the key pair belongs.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

GetKeyPairs Result

The following output properties are available:

FingerPrint string

Finger print of the key pair.

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
KeyPairs List<Pulumi.AliCloud.Ecs.Outputs.GetKeyPairsKeyPair>

A list of key pairs. Each element contains the following attributes:

Names List<string>

A list of key pair names.

NameRegex string
OutputFile string
ResourceGroupId string

The Id of resource group.

Tags Dictionary<string, object>

(Optional, Available in v1.66.0+) A mapping of tags to assign to the resource.

FingerPrint string

Finger print of the key pair.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string
KeyPairs []GetKeyPairsKeyPair

A list of key pairs. Each element contains the following attributes:

Names []string

A list of key pair names.

NameRegex string
OutputFile string
ResourceGroupId string

The Id of resource group.

Tags map[string]interface{}

(Optional, Available in v1.66.0+) A mapping of tags to assign to the resource.

fingerPrint string

Finger print of the key pair.

id string

The provider-assigned unique ID for this managed resource.

ids string[]
keyPairs GetKeyPairsKeyPair[]

A list of key pairs. Each element contains the following attributes:

names string[]

A list of key pair names.

nameRegex string
outputFile string
resourceGroupId string

The Id of resource group.

tags {[key: string]: any}

(Optional, Available in v1.66.0+) A mapping of tags to assign to the resource.

finger_print str

Finger print of the key pair.

id str

The provider-assigned unique ID for this managed resource.

ids List[str]
key_pairs List[GetKeyPairsKeyPair]

A list of key pairs. Each element contains the following attributes:

names List[str]

A list of key pair names.

name_regex str
output_file str
resource_group_id str

The Id of resource group.

tags Dict[str, Any]

(Optional, Available in v1.66.0+) A mapping of tags to assign to the resource.

Supporting Types

GetKeyPairsKeyPair

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

FingerPrint string

A finger print used to retrieve specified key pair.

Id string

ID of the key pair.

Instances List<Pulumi.AliCloud.Ecs.Inputs.GetKeyPairsKeyPairInstanceArgs>

A list of ECS instances that has been bound this key pair.

KeyName string

Name of the key pair.

ResourceGroupId string

The Id of resource group which the key pair belongs.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

FingerPrint string

A finger print used to retrieve specified key pair.

Id string

ID of the key pair.

Instances []GetKeyPairsKeyPairInstance

A list of ECS instances that has been bound this key pair.

KeyName string

Name of the key pair.

ResourceGroupId string

The Id of resource group which the key pair belongs.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

fingerPrint string

A finger print used to retrieve specified key pair.

id string

ID of the key pair.

instances GetKeyPairsKeyPairInstance[]

A list of ECS instances that has been bound this key pair.

keyName string

Name of the key pair.

resourceGroupId string

The Id of resource group which the key pair belongs.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

finger_print str

A finger print used to retrieve specified key pair.

id str

ID of the key pair.

instances List[GetKeyPairsKeyPairInstance]

A list of ECS instances that has been bound this key pair.

key_name str

Name of the key pair.

resource_group_id str

The Id of resource group which the key pair belongs.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

GetKeyPairsKeyPairInstance

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AvailabilityZone string

The ID of the availability zone where the ECS instance is located.

Description string
ImageId string
InstanceId string

The ID of the ECS instance.

InstanceName string

The name of the ECS instance.

InstanceType string
KeyName string

Name of the key pair.

PrivateIp string

The private IP address of the ECS instance.

PublicIp string

The public IP address or EIP of the ECS instance.

RegionId string
Status string
VswitchId string

The ID of the VSwitch attached to the ECS instance.

AvailabilityZone string

The ID of the availability zone where the ECS instance is located.

Description string
ImageId string
InstanceId string

The ID of the ECS instance.

InstanceName string

The name of the ECS instance.

InstanceType string
KeyName string

Name of the key pair.

PrivateIp string

The private IP address of the ECS instance.

PublicIp string

The public IP address or EIP of the ECS instance.

RegionId string
Status string
VswitchId string

The ID of the VSwitch attached to the ECS instance.

availabilityZone string

The ID of the availability zone where the ECS instance is located.

description string
imageId string
instanceId string

The ID of the ECS instance.

instanceName string

The name of the ECS instance.

instanceType string
keyName string

Name of the key pair.

privateIp string

The private IP address of the ECS instance.

publicIp string

The public IP address or EIP of the ECS instance.

regionId string
status string
vswitchId string

The ID of the VSwitch attached to the ECS instance.

availability_zone str

The ID of the availability zone where the ECS instance is located.

description str
image_id str
instance_id str

The ID of the ECS instance.

instance_name str

The name of the ECS instance.

instance_type str
key_name str

Name of the key pair.

private_ip str

The private IP address of the ECS instance.

public_ip str

The public IP address or EIP of the ECS instance.

regionId str
status str
vswitch_id str

The ID of the VSwitch attached to the ECS instance.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.