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:
- Finger
Print string A finger print used to retrieve specified key pair.
- Ids List<string>
A list of key pair IDs.
- Name
Regex string A regex string to apply to the resulting key pairs.
- Output
File string - Resource
Group stringId The Id of resource group which the key pair belongs.
- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Finger
Print string A finger print used to retrieve specified key pair.
- Ids []string
A list of key pair IDs.
- Name
Regex string A regex string to apply to the resulting key pairs.
- Output
File string - Resource
Group stringId The Id of resource group which the key pair belongs.
- map[string]interface{}
A mapping of tags to assign to the resource.
- finger
Print string A finger print used to retrieve specified key pair.
- ids string[]
A list of key pair IDs.
- name
Regex string A regex string to apply to the resulting key pairs.
- output
File string - resource
Group stringId The Id of resource group which the key pair belongs.
- {[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_ strid The Id of resource group which the key pair belongs.
- Dict[str, Any]
A mapping of tags to assign to the resource.
GetKeyPairs Result
The following output properties are available:
- Finger
Print string Finger print of the key pair.
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Key
Pairs List<Pulumi.Ali Cloud. Ecs. Outputs. Get Key Pairs Key Pair> A list of key pairs. Each element contains the following attributes:
- Names List<string>
A list of key pair names.
- Name
Regex string - Output
File string - Resource
Group stringId The Id of resource group.
- Dictionary<string, object>
(Optional, Available in v1.66.0+) A mapping of tags to assign to the resource.
- Finger
Print string Finger print of the key pair.
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
- Key
Pairs []GetKey Pairs Key Pair A list of key pairs. Each element contains the following attributes:
- Names []string
A list of key pair names.
- Name
Regex string - Output
File string - Resource
Group stringId The Id of resource group.
- map[string]interface{}
(Optional, Available in v1.66.0+) A mapping of tags to assign to the resource.
- finger
Print string Finger print of the key pair.
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
- key
Pairs GetKey Pairs Key Pair[] A list of key pairs. Each element contains the following attributes:
- names string[]
A list of key pair names.
- name
Regex string - output
File string - resource
Group stringId The Id of resource group.
- {[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[GetKey Pairs Key Pair] 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_ strid The Id of resource group.
- 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.
- Finger
Print string A finger print used to retrieve specified key pair.
- Id string
ID of the key pair.
- Instances
List<Pulumi.
Ali Cloud. Ecs. Inputs. Get Key Pairs Key Pair Instance Args> A list of ECS instances that has been bound this key pair.
- Key
Name string Name of the key pair.
- Resource
Group stringId The Id of resource group which the key pair belongs.
- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Finger
Print string A finger print used to retrieve specified key pair.
- Id string
ID of the key pair.
- Instances
[]Get
Key Pairs Key Pair Instance A list of ECS instances that has been bound this key pair.
- Key
Name string Name of the key pair.
- Resource
Group stringId The Id of resource group which the key pair belongs.
- map[string]interface{}
A mapping of tags to assign to the resource.
- finger
Print string A finger print used to retrieve specified key pair.
- id string
ID of the key pair.
- instances
Get
Key Pairs Key Pair Instance[] A list of ECS instances that has been bound this key pair.
- key
Name string Name of the key pair.
- resource
Group stringId The Id of resource group which the key pair belongs.
- {[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[Get
Key Pairs Key Pair Instance] A list of ECS instances that has been bound this key pair.
- key_
name str Name of the key pair.
- resource_
group_ strid The Id of resource group which the key pair belongs.
- 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.
- Availability
Zone string The ID of the availability zone where the ECS instance is located.
- Description string
- Image
Id string - Instance
Id string The ID of the ECS instance.
- Instance
Name string The name of the ECS instance.
- Instance
Type string - Key
Name string Name of the key pair.
- Private
Ip string The private IP address of the ECS instance.
- Public
Ip string The public IP address or EIP of the ECS instance.
- Region
Id string - Status string
- Vswitch
Id string The ID of the VSwitch attached to the ECS instance.
- Availability
Zone string The ID of the availability zone where the ECS instance is located.
- Description string
- Image
Id string - Instance
Id string The ID of the ECS instance.
- Instance
Name string The name of the ECS instance.
- Instance
Type string - Key
Name string Name of the key pair.
- Private
Ip string The private IP address of the ECS instance.
- Public
Ip string The public IP address or EIP of the ECS instance.
- Region
Id string - Status string
- Vswitch
Id string The ID of the VSwitch attached to the ECS instance.
- availability
Zone string The ID of the availability zone where the ECS instance is located.
- description string
- image
Id string - instance
Id string The ID of the ECS instance.
- instance
Name string The name of the ECS instance.
- instance
Type string - key
Name string Name of the key pair.
- private
Ip string The private IP address of the ECS instance.
- public
Ip string The public IP address or EIP of the ECS instance.
- region
Id string - status string
- vswitch
Id 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.
- region
Id 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
alicloudTerraform Provider.